Skip to content

Commit 27565b4

Browse files
wsmosesavik-palgithub-actions[bot]
authored
windows ci (#1562)
* windows ci Update CI.yml Update Project.toml mem issue fix * fix: try avoiding Ref * fix: gc preserve? * fix * Fix * fix * Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * run ci --------- Co-authored-by: Avik Pal <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 5292213 commit 27565b4

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.github/workflows/CI.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
# <https://github.com/EnzymeAD/Reactant.jl/issues/867> is resolved.
5252
# - macOS-13
5353
- macOS-latest
54+
- windows-latest
5455
test_group:
5556
- core
5657
- neural_networks
@@ -108,10 +109,13 @@ jobs:
108109
# We have to use `${GITHUB_WORKSPACE}` instead of `github.workspace` because GitHub
109110
# is terrible and the two don't match inside containers:
110111
# https://github.com/actions/runner/issues/2058
112+
113+
if: ${{ matrix.os != 'windows-latest' }}
111114
run: |
112115
echo "TMPDIR=${GITHUB_WORKSPACE}/tmp" >> ${GITHUB_ENV}
113116
- uses: actions/checkout@v4
114117
- name: Create TMPDIR
118+
if: ${{ matrix.os != 'windows-latest' }}
115119
run: |
116120
mkdir -p ${{ env.TMPDIR }}
117121
- uses: julia-actions/setup-julia@v2

ext/ReactantCUDAExt.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,17 +1216,19 @@ Reactant.@reactant_overlay @noinline function (func::LLVMFunc{F,tt})(
12161216
push!(restys, MLIR.IR.type(arg))
12171217
push!(mlir_args, arg)
12181218

1219+
ctx = MLIR.IR.context()
1220+
out_tup = Ref{Int64}(argidx - 1)
12191221
push!(
12201222
aliases,
12211223
MLIR.IR.Attribute(
1222-
MLIR.API.stablehloOutputOperandAliasGet(
1223-
MLIR.IR.context(),
1224+
GC.@preserve ctx out_tup MLIR.API.stablehloOutputOperandAliasGet(
1225+
ctx,
12241226
length(wrapper_tys) == 1 ? 0 : 1,
1225-
length(wrapper_tys) == 1 ? C_NULL : Ref{Int64}(argidx - 1),
1227+
pointer_from_objref(out_tup),
12261228
argidx - 1,
12271229
0,
12281230
C_NULL,
1229-
),
1231+
)
12301232
),
12311233
)
12321234

src/Ops.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,11 +966,12 @@ Base.@nospecializeinfer @noinline function dot_general(
966966
rhs_batching_dimensions = rhs_batching_dimensions .- 1
967967
lhs_contracting_dimensions = lhs_contracting_dimensions .- 1
968968
rhs_contracting_dimensions = rhs_contracting_dimensions .- 1
969+
ctx = MLIR.IR.context()
969970

970-
dot_dimension_numbers = GC.@preserve lhs_contracting_dimensions rhs_contracting_dimensions lhs_batching_dimensions rhs_batching_dimensions begin
971+
dot_dimension_numbers = GC.@preserve ctx lhs_contracting_dimensions rhs_contracting_dimensions lhs_batching_dimensions rhs_batching_dimensions begin
971972
MLIR.IR.Attribute(
972973
MLIR.API.stablehloDotDimensionNumbersGet(
973-
MLIR.IR.context(),
974+
ctx,
974975
length(lhs_batching_dimensions),
975976
lhs_batching_dimensions,
976977
length(rhs_batching_dimensions),

src/mlir/libMLIR_h.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ elseif Sys.iswindows() && Sys.ARCH === :x86_64
3939
const off_t = off32_t
4040
end
4141

42-
const intptr_t = Clong
42+
const intptr_t = Cptrdiff_t
4343

4444
struct MlirDialectHandle
4545
ptr::Ptr{Cvoid}

0 commit comments

Comments
 (0)