-
Notifications
You must be signed in to change notification settings - Fork 117
[Fix issue #1023]: T.tile.atomic_add with slice syntax + vector lane variables #1034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,6 +330,9 @@ Stmt AscendCopy::Lower(const LowerArgs &T, arith::Analyzer *analyzer) const { | |
| auto compute_valid_extent = [](PrimExpr min_val, PrimExpr extent, | ||
| PrimExpr shape) -> PrimExpr { | ||
| PrimExpr remaining = shape - min_val; | ||
| if (remaining.dtype().lanes() > 1) { | ||
| return extent; | ||
| } | ||
| return Select(remaining >= extent, extent, | ||
| Select(remaining > 0, remaining, 0)); | ||
| }; | ||
|
|
@@ -570,6 +573,9 @@ Stmt AscendAtomicAdd::Lower(const LowerArgs &T, | |
| auto compute_valid_extent = [](PrimExpr min_val, PrimExpr extent, | ||
| PrimExpr shape) -> PrimExpr { | ||
| PrimExpr remaining = shape - min_val; | ||
| if (remaining.dtype().lanes() > 1) { | ||
| return extent; | ||
| } | ||
| return Select(remaining >= extent, extent, | ||
| Select(remaining > 0, remaining, 0)); | ||
| }; | ||
|
|
@@ -612,10 +618,6 @@ Stmt AscendAtomicAdd::Lower(const LowerArgs &T, | |
| ICHECK_EQ(dst_extents.size(), dst->shape.size()) | ||
| << "tl.ascend_atomic_add destination region rank must match " | ||
| "destination buffer rank"; | ||
| ICHECK_EQ(src_extents.size(), dst_extents.size()) | ||
| << "tl.ascend_atomic_add requires src and dst regions to have the same " | ||
| "rank, got src " | ||
| << src_extents.size() << " and dst " << dst_extents.size(); | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rank equality check between |
||
| std::stringstream ss; | ||
| if (src.scope() == "shared") { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for
compute_valid_extentis duplicated here fromAscendCopy::Lower(line 333). To improve maintainability and reduce code duplication, consider refactoring this into a shared helper function or a static method within the file.