"git@developer.sourcefind.cn:gaoqiong/composable_kernel.git" did not exist on "79ba5b9969b04d2b70fc722e497e5ef664df3eb6"
Unverified Commit eccdfe17 authored by coderabbitai[bot]'s avatar coderabbitai[bot] Committed by GitHub
Browse files

📝 Add docstrings to PR #744 (#745)

* 📝 Add docstrings to `main`

Docstrings generation was requested by @LeiWang1999.

* https://github.com/tile-ai/tilelang/pull/742#issuecomment-3205103559



The following files were modified:

* `src/transform/atomicadd_vectorize.cc`

* lint fix

---------
Co-authored-by: default avatarcoderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: default avatarLeiWang1999 <leiwang1999@outlook.com>
parent ce7b9323
...@@ -146,6 +146,32 @@ public: ...@@ -146,6 +146,32 @@ public:
dynamic_(plan.dynamic) {} dynamic_(plan.dynamic) {}
private: private:
/**
* @brief Visits a For node and rewrites the innermost loop for atomic-add
* vectorization.
*
* If the visited For node is the recorded innermost loop, this method
* validates that the loop extent is a constant, divisible by the planned
* vector size, and has a zero minimum. When vectorization is enabled
* (dynamic_ == false) it:
* - locates the thread index variable named "tx" inside the loop body,
* - creates a new outer loop variable named "<old_loop_var>_outer",
* - substitutes occurrences of `tx` with `tx * vector_size_` and the old
* loop var with `outer_var * vector_size_` so each outer iteration maps to a
* contiguous vector-sized chunk,
* - returns a new For with extent divided by vector_size_ and the
* transformed body.
*
* If dynamic_ is true, the method returns the (possibly mutated) inner For
* unchanged.
*
* Side effects:
* - updates inner_for_ to point to the current For node during visitation.
* - performs runtime checks (ICHECK) to enforce: constant extent, extent %
* vector_size_ == 0, and zero loop minimum; violations terminate execution.
*
* @return The original or transformed For statement as a Stmt.
*/
Stmt VisitStmt_(const ForNode *node) final { Stmt VisitStmt_(const ForNode *node) final {
inner_for_ = node; inner_for_ = node;
auto ret = StmtExprMutator::VisitStmt_(node); auto ret = StmtExprMutator::VisitStmt_(node);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment