From 14afa8fc0cb4ccff9d1155f1504c207c4c43d615 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:06:38 -0300 Subject: [PATCH] [only tests] --- test/array.jl | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/array.jl b/test/array.jl index 567323842..e2aaaacc2 100644 --- a/test/array.jl +++ b/test/array.jl @@ -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 @@ -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))