Skip to content

Commit 08045e6

Browse files
committed
Fix what seems to be a silly bug in gpu.set_default_device rewriting.
Smoke test included.
1 parent 282d501 commit 08045e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,8 +1334,9 @@ LogicalResult ConvertSetDefaultDeviceOpToGpuRuntimeCallPattern::matchAndRewrite(
13341334
gpu::SetDefaultDeviceOp op, OpAdaptor adaptor,
13351335
ConversionPatternRewriter &rewriter) const {
13361336
Location loc = op.getLoc();
1337-
setDefaultDeviceCallBuilder.create(loc, rewriter, {adaptor.getDevIndex()});
1338-
rewriter.replaceOp(op, {});
1337+
auto call = setDefaultDeviceCallBuilder.create(loc, rewriter,
1338+
{adaptor.getDevIndex()});
1339+
rewriter.replaceOp(op, call);
13391340
return success();
13401341
}
13411342

0 commit comments

Comments
 (0)