Skip to content

Commit f2a8bc6

Browse files
authored
Fix tr test for GPU arrays with @allowscalar
Use @allowscalar for tr function to handle GPU array regression.
1 parent e78cee4 commit f2a8bc6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/test_basics.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ arrayts = (Array, JLArray)
272272
for p in 1:3
273273
@test norm(a, p) norm(Array(a), p)
274274
end
275-
@test tr(a) tr(Array(a))
275+
# We use `@allowscalar` here since there seems to be a regression
276+
# in `tr` of GPU arrays for that operation.
277+
@test @allowscalar(tr(a)) tr(Array(a))
276278

277279
a[3, 3] = NaN
278280
@test isnan(norm(a))

0 commit comments

Comments
 (0)