Skip to content

Commit 33da495

Browse files
committed
Fix nvvm.maxntidx attr name
1 parent 004eb02 commit 33da495

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/polygeist/Passes/ConvertParallelToGPU.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,15 @@ struct AddLaunchBounds : public OpRewritePattern<gpu::LaunchFuncOp> {
129129
// to only set idx to the total num
130130
// TODO grab the attr name from the NVVM dialect after bumping llvm
131131
int blockSize = *bx * *by * *bz;
132-
if (!gpuFuncOp->hasAttr("maxntidx")) {
133-
gpuFuncOp->setAttr("maxntidx", rewriter.getIntegerAttr(
134-
rewriter.getIndexType(), blockSize));
132+
if (!gpuFuncOp->hasAttr("nvvm.maxntidx")) {
133+
gpuFuncOp->setAttr(
134+
"nvvm.maxntidx",
135+
rewriter.getIntegerAttr(rewriter.getIndexType(), blockSize));
135136
return success();
136137
} else {
137-
assert(blockSize ==
138-
gpuFuncOp->getAttr("maxntidx").dyn_cast<IntegerAttr>().getInt());
139-
// TODO assert it is the same
138+
assert(
139+
blockSize ==
140+
gpuFuncOp->getAttr("nvvm.maxntidx").dyn_cast<IntegerAttr>().getInt());
140141
return failure();
141142
}
142143
}

0 commit comments

Comments
 (0)