Skip to content

Commit e762b01

Browse files
Adjust random tests to avoid spurious test failures. (#506)
1 parent ea1d6ad commit e762b01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/random.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ const OOPLACE_TUPLES = [[(Metal.rand, rand, T) for T in RAND_TYPES];
1212
rng = Metal.MPS.RNG()
1313

1414
@testset "$f with $T" for (f, T) in INPLACE_TUPLES
15-
@testset "$d" for d in (1, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000))
15+
# d == 2 and d == 3 are to hit the test cases where sizeof(A) <= 4
16+
@testset "$d" for d in (2, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000))
1617
A = MtlArray{T}(undef, d)
1718

1819
# default_rng
@@ -224,7 +225,8 @@ const OOPLACE_TUPLES = [[(Metal.rand, rand, T) for T in RAND_TYPES];
224225
end
225226
rng = Metal.MPS.RNG()
226227
@testset "$f with $T" for (f, T) in mps_tuples
227-
@testset "$d" for d in (1, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000))
228+
# d == 2 and d == 3 are to hit the test cases where sizeof(A) <= 4
229+
@testset "$d" for d in (2, 3, (3, 3), (3, 3, 3), 16, (16, 16), (16, 16, 16), (1000,), (1000,1000))
228230
A = zeros(T, d)
229231
if (prod(d) * sizeof(T)) % 4 == 0
230232
f(rng, A)

0 commit comments

Comments
 (0)