@@ -16,6 +16,12 @@ function square!(x, y)
1616 return nothing
1717end
1818
19+ # GPUCompiler throws "Not implemented" errors on aarch64 before
20+ # <https://github.com/JuliaLang/julia/pull/57077> for some tests.
21+ const skip_tests =
22+ Base. BinaryPlatforms. arch (Base. BinaryPlatforms. HostPlatform ()) == " aarch" &&
23+ VERSION <= v " 1.11.2"
24+
1925@static if ! Sys. isapple ()
2026 @testset " Square Kernel" begin
2127 oA = collect (1 : 1 : 64 )
2632 @test all (Array (A) .≈ (oA .* oA .* 100 ))
2733 @test all (Array (B) .≈ (oA .* 100 ))
2834 else
29- @code_hlo optimize = :before_kernel square! (A, B)
35+ @static if ! skip_tests
36+ @code_hlo optimize = :before_kernel square! (A, B)
37+ end
3038 end
3139 end
3240end
5361 @test all (Array (A) .≈ oA .* sin .(oA .* 100 ))
5462 @test all (Array (B) .≈ (oA .* 100 ))
5563 else
56- @code_hlo optimize = :before_kernel sin! (A, B)
64+ @static if ! skip_tests
65+ @code_hlo optimize = :before_kernel sin! (A, B)
66+ end
5767 end
5868 end
5969end
7989 @jit smul! (A)
8090 @test all (Array (A) .≈ oA .* 15 )
8191 else
82- @code_hlo optimize = :before_kernel smul! (A)
92+ @static if ! skip_tests
93+ @code_hlo optimize = :before_kernel smul! (A)
94+ end
8395 end
8496 end
8597end
@@ -104,7 +116,9 @@ tuplef2(a) = @cuda threads = 1 tuplef2!((5, a))
104116 @jit tuplef (A)
105117 @test all (Array (A) .≈ 3 )
106118 else
107- @code_hlo optimize = :before_kernel tuplef (A)
119+ @static if ! skip_tests
120+ @code_hlo optimize = :before_kernel tuplef (A)
121+ end
108122 end
109123
110124 A = ConcreteRArray (fill (1 ))
@@ -120,7 +134,9 @@ tuplef2(a) = @cuda threads = 1 tuplef2!((5, a))
120134 @jit tuplef2 (A)
121135 @test all (Array (A) .≈ 5 )
122136 else
123- @code_hlo optimize = :before_kernel tuplef2 (A)
137+ @static if ! skip_tests
138+ @code_hlo optimize = :before_kernel tuplef2 (A)
139+ end
124140 end
125141end
126142
0 commit comments