From e762b0160d4f666531d74e17d96646cc4b2e9f56 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sat, 21 Dec 2024 03:32:32 -0400 Subject: [PATCH] Adjust random tests to avoid spurious test failures. (#506) --- test/random.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/random.jl b/test/random.jl index 3066acb5..88180e94 100644 --- a/test/random.jl +++ b/test/random.jl @@ -12,7 +12,8 @@ const OOPLACE_TUPLES = [[(Metal.rand, rand, T) for T in RAND_TYPES]; rng = Metal.MPS.RNG() @testset "$f with $T" for (f, T) in INPLACE_TUPLES - @testset "$d" for d in (1, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000)) + # d == 2 and d == 3 are to hit the test cases where sizeof(A) <= 4 + @testset "$d" for d in (2, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000)) A = MtlArray{T}(undef, d) # default_rng @@ -224,7 +225,8 @@ const OOPLACE_TUPLES = [[(Metal.rand, rand, T) for T in RAND_TYPES]; end rng = Metal.MPS.RNG() @testset "$f with $T" for (f, T) in mps_tuples - @testset "$d" for d in (1, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000)) + # d == 2 and d == 3 are to hit the test cases where sizeof(A) <= 4 + @testset "$d" for d in (2, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000)) A = zeros(T, d) if (prod(d) * sizeof(T)) % 4 == 0 f(rng, A)