Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get more descriptive errors from flaky test #440

Merged
merged 1 commit into from
Sep 30, 2024
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
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