Skip to content

Commit fec9b93

Browse files
chengyupkuLeiWang1999gemini-code-assist[bot]
authored
[Bugfix] Adjust role assignment in warp specialization based on read access (#647)
* [Bugfix] Adjust role assignment in warp specialization based on read access - Updated the role assignment logic in `warp_specialized_rewriter.cc` to set the role to `kConsumer` when no reads are detected, ensuring correct behavior in memory access scenarios. * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: Lei Wang <34334180+LeiWang1999@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 3a40815 commit fec9b93

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/transform/warp_specialized_rewriter.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ class WarpSpecializedRoleMarker : public StmtVisitor {
129129
auto access = GetBlockReadWriteRegion(block, buffer_data_to_buffer_);
130130
auto reads = access[0];
131131
Role role = Role::kProducer;
132+
if (reads.empty())
133+
role = Role::kConsumer;
132134
for (auto read : reads) {
133135
if (read->buffer.scope() != "global") {
134136
role = Role::kConsumer;

0 commit comments

Comments
 (0)