Skip to content

Commit

Permalink
Get more descriptive errors from flaky test (#440)
Browse files Browse the repository at this point in the history
[only tests]
  • Loading branch information
christiangnrd authored Sep 30, 2024
1 parent b999285 commit f605bcb
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions test/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,28 +210,34 @@ end

# Dims in tuple
let A = Metal.fill(b, (10, 10, 10, 1000))
@test all(Array(A) .== b)
B = fill(b, (10, 10, 10, 1000))
@test Array(A) == B
end

let M = Metal.fill(b, (10, 10))
@test all(Array(M) .== b)
let M = Metal.fill(b, (10, 10, 10, 1000))
B = fill(b, (10, 10, 10, 1000))
@test Array(M) == B
end

let V = Metal.fill(b, (10,))
@test all(Array(V) .== b)
B = fill(b, (10,))
@test Array(V) == B
end

#Dims already unpacked
let A = Metal.fill(b, 10, 10, 10, 1000)
@test all(Array(A) .== b)
B = fill(b, 10, 10, 10, 1000)
@test Array(A) == B
end

let M = Metal.fill(b, 10, 10)
@test all(Array(M) .== b)
B = fill(b, 10, 10)
@test Array(M) == B
end

let V = Metal.fill(b, 10)
@test all(Array(V) .== b)
B = fill(b, 10)
@test Array(V) == B
end
end

Expand Down Expand Up @@ -420,7 +426,7 @@ end

@testset "broadcast" begin
testf(f, x) = Array(f(MtlArray(x))) f(x)

@test testf(x->max.(x, zero(Float32)), randn(Float32, 1000))
@test testf(x->min.(x, one(Float32)), randn(Float32, 1000))
@test testf(x->min.(max.(x, zero(Float32)), one(Float32)), randn(Float32, 1000))
Expand Down

0 comments on commit f605bcb

Please sign in to comment.