Skip to content

Commit 240a3e4

Browse files
authored
Fix assume range (#176)
1 parent 48d72fe commit 240a3e4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

numba_dpcomp/numba_dpcomp/mlir_compiler/lib/pipelines/lower_to_gpu.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -875,11 +875,12 @@ struct AssumeGpuIdRangePass
875875

876876
mlir::OpBuilder builder(&getContext());
877877
builder.setInsertionPointToStart(&op->getRegion(0).front());
878-
auto maxInt = builder
879-
.create<mlir::arith::ConstantIndexOp>(
880-
builder.getUnknownLoc(),
881-
std::numeric_limits<int32_t>::max() + 1)
882-
.getResult();
878+
auto maxInt =
879+
builder
880+
.create<mlir::arith::ConstantIndexOp>(
881+
builder.getUnknownLoc(),
882+
static_cast<int64_t>(std::numeric_limits<int32_t>::max()) + 1)
883+
.getResult();
883884

884885
op->walk([&](mlir::Operation *nestedOp) {
885886
if (!mlir::isa<mlir::gpu::ThreadIdOp, mlir::gpu::BlockIdOp,

0 commit comments

Comments
 (0)