Skip to content

Commit 72bb8e1

Browse files
Improve Metal.jl tests
- Simplify test to directly check that lu_instance returns an LU type - Make Metal tests only run on macOS using Sys.isapple() check - Add LinearAlgebra import for LU type check 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 5058a72 commit 72bb8e1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

test/gpu/metal.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using Metal
22
using ArrayInterface
3+
using LinearAlgebra
34

45
using Test
56

6-
# Test whether lu_instance throws an error when invoked with a Metal.jl gpu array
7-
@test !isa(try ArrayInterface.lu_instance(MtlArray([1.f0 1.f0; 1.f0 1.f0])) catch ex ex end, Exception)
7+
# Test that lu_instance works with Metal.jl gpu arrays
8+
@test isa(ArrayInterface.lu_instance(MtlArray([1.f0 1.f0; 1.f0 1.f0])), LU)

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ end
2121
if GROUP == "GPU"
2222
activate_gpu_env()
2323
@time @safetestset "CUDA" begin include("gpu/cuda.jl") end
24-
@time @safetestset "Metal" begin include("gpu/metal.jl") end
24+
if Sys.isapple()
25+
@time @safetestset "Metal" begin include("gpu/metal.jl") end
26+
end
2527
end
2628
end

0 commit comments

Comments
 (0)