Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
# <https://github.com/EnzymeAD/Reactant.jl/issues/867> is resolved.
# - macOS-13
- macOS-latest
- windows-latest
test_group:
- core
- neural_networks
Expand Down Expand Up @@ -108,10 +109,13 @@ jobs:
# We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub
# is terrible and the two don't match inside containers:
# https://github.com/actions/runner/issues/2058

if: ${{ matrix.os != 'windows-latest' }}
run: |
echo "TMPDIR=${GITHUB_WORKSPACE}/tmp" >> ${GITHUB_ENV}
- uses: actions/checkout@v4
- name: Create TMPDIR
if: ${{ matrix.os != 'windows-latest' }}
run: |
mkdir -p ${{ env.TMPDIR }}
- uses: julia-actions/setup-julia@v2
Expand Down
10 changes: 6 additions & 4 deletions ext/ReactantCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1216,17 +1216,19 @@ Reactant.@reactant_overlay @noinline function (func::LLVMFunc{F,tt})(
push!(restys, MLIR.IR.type(arg))
push!(mlir_args, arg)

ctx = MLIR.IR.context()
out_tup = Ref{Int64}(argidx - 1)
push!(
aliases,
MLIR.IR.Attribute(
MLIR.API.stablehloOutputOperandAliasGet(
MLIR.IR.context(),
GC.@preserve ctx out_tup MLIR.API.stablehloOutputOperandAliasGet(
ctx,
length(wrapper_tys) == 1 ? 0 : 1,
length(wrapper_tys) == 1 ? C_NULL : Ref{Int64}(argidx - 1),
pointer_from_objref(out_tup),
argidx - 1,
0,
C_NULL,
),
)
),
)

Expand Down
5 changes: 3 additions & 2 deletions src/Ops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,12 @@ Base.@nospecializeinfer @noinline function dot_general(
rhs_batching_dimensions = rhs_batching_dimensions .- 1
lhs_contracting_dimensions = lhs_contracting_dimensions .- 1
rhs_contracting_dimensions = rhs_contracting_dimensions .- 1
ctx = MLIR.IR.context()

dot_dimension_numbers = GC.@preserve lhs_contracting_dimensions rhs_contracting_dimensions lhs_batching_dimensions rhs_batching_dimensions begin
dot_dimension_numbers = GC.@preserve ctx lhs_contracting_dimensions rhs_contracting_dimensions lhs_batching_dimensions rhs_batching_dimensions begin
MLIR.IR.Attribute(
MLIR.API.stablehloDotDimensionNumbersGet(
MLIR.IR.context(),
ctx,
length(lhs_batching_dimensions),
lhs_batching_dimensions,
length(rhs_batching_dimensions),
Expand Down
2 changes: 1 addition & 1 deletion src/mlir/libMLIR_h.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ elseif Sys.iswindows() && Sys.ARCH === :x86_64
const off_t = off32_t
end

const intptr_t = Clong
const intptr_t = Cptrdiff_t

struct MlirDialectHandle
ptr::Ptr{Cvoid}
Expand Down
Loading