Skip to content

Commit 59ac689

Browse files
committed
fix: gc preserve?
1 parent c9e85b5 commit 59ac689

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

ext/ReactantCUDAExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,10 +1208,10 @@ Reactant.@reactant_overlay @noinline function (func::LLVMFunc{F,tt})(
12081208
MLIR.API.stablehloOutputOperandAliasGet(
12091209
MLIR.IR.context(),
12101210
length(wrapper_tys) == 1 ? 0 : 1,
1211-
length(wrapper_tys) == 1 ? Int64[] : Int64[argidx - 1],
1211+
length(wrapper_tys) == 1 ? C_NULL : Ref{Int64}(argidx - 1),
12121212
argidx - 1,
12131213
0,
1214-
Int64[],
1214+
C_NULL,
12151215
),
12161216
),
12171217
)

src/mlir/libMLIR_h.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10334,14 +10334,16 @@ function stablehloOutputOperandAliasGet(
1033410334
nOperandTupleIndices,
1033510335
operandTupleIndices,
1033610336
)
10337-
@ccall mlir_c.stablehloOutputOperandAliasGet(
10338-
ctx::MlirContext,
10339-
nOutputTupleIndices::intptr_t,
10340-
outputTupleIndices::Ptr{Int64},
10341-
operandIndex::Int64,
10342-
nOperandTupleIndices::intptr_t,
10343-
operandTupleIndices::Ptr{Int64},
10344-
)::MlirAttribute
10337+
GC.@preserve outputTupleIndices operandTupleIndices begin
10338+
@ccall mlir_c.stablehloOutputOperandAliasGet(
10339+
ctx::MlirContext,
10340+
nOutputTupleIndices::intptr_t,
10341+
outputTupleIndices::Ptr{Int64},
10342+
operandIndex::Int64,
10343+
nOperandTupleIndices::intptr_t,
10344+
operandTupleIndices::Ptr{Int64},
10345+
)::MlirAttribute
10346+
end
1034510347
end
1034610348

1034710349
function stablehloAttributeIsAOutputOperandAlias(attr)

0 commit comments

Comments
 (0)