Skip to content
Merged
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
35 changes: 23 additions & 12 deletions test/integration/cuda.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ function square!(x, y)
return nothing
end

# GPUCompiler throws "Not implemented" errors on aarch64 before
# <https://github.com/JuliaLang/julia/pull/57077> for some tests.
const skip_tests =
Base.BinaryPlatforms.arch(Base.BinaryPlatforms.HostPlatform()) == "aarch64" &&
VERSION <= v"1.11.3"
# https://github.com/EnzymeAD/Reactant.jl/issues/614
const skip_non_cuda_tests = true

@static if !Sys.isapple()
@testset "Square Kernel" begin
Expand All @@ -32,7 +29,9 @@ const skip_tests =
@test all(Array(A) .≈ (oA .* oA .* 100))
@test all(Array(B) .≈ (oA .* 100))
else
@static if !skip_tests
@static if skip_non_cuda_tests
@test false broken = true
else
@code_hlo optimize = :before_kernel square!(A, B)
end
end
Expand Down Expand Up @@ -61,7 +60,9 @@ end
@test all(Array(A) .≈ oA .* sin.(oA .* 100))
@test all(Array(B) .≈ (oA .* 100))
else
@static if !skip_tests
@static if skip_non_cuda_tests
@test false broken = true
else
@code_hlo optimize = :before_kernel sin!(A, B)
end
end
Expand Down Expand Up @@ -89,7 +90,9 @@ end
@jit smul!(A)
@test all(Array(A) .≈ oA .* 15)
else
@static if !skip_tests
@static if skip_non_cuda_tests
@test false broken = true
else
@code_hlo optimize = :before_kernel smul!(A)
end
end
Expand All @@ -116,7 +119,9 @@ tuplef2(a) = @cuda threads = 1 tuplef2!((5, a))
@jit tuplef(A)
@test all(Array(A) .≈ 3)
else
@static if !skip_tests
@static if skip_non_cuda_tests
@test false broken = true
else
@code_hlo optimize = :before_kernel tuplef(A)
end
end
Expand All @@ -126,7 +131,9 @@ tuplef2(a) = @cuda threads = 1 tuplef2!((5, a))
@jit tuplef2(A)
@test all(Array(A) .≈ 5)
else
@static if !skip_tests
@static if skip_non_cuda_tests
@test false broken = true
else
@code_hlo optimize = :before_kernel tuplef2(A)
end
end
Expand All @@ -136,7 +143,9 @@ tuplef2(a) = @cuda threads = 1 tuplef2!((5, a))
@jit tuplef2(A)
@test all(Array(A) .≈ 5)
else
@static if !skip_tests
@static if skip_non_cuda_tests
@test false broken = true
else
@code_hlo optimize = :before_kernel tuplef2(A)
end
end
Expand Down Expand Up @@ -164,7 +173,9 @@ end
@jit aliased(a)
@test all(Array(a) .== 9)
else
@static if !skip_tests
@static if skip_non_cuda_tests
@test false broken = true
else
@code_hlo optimize = :before_kernel aliased(a)
end
end
Expand Down
Loading