Skip to content

Commit 719b4c4

Browse files
authored
Simple tests for check and explain_eltype (#2748)
1 parent 160f941 commit 719b4c4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/base/array.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ using ChainRulesCore: add!!, is_inplaceable_destination
5151
end
5252
end
5353

54+
mutable struct MyBadType
55+
a::Any
56+
end
57+
const MyBadType2 = Union{BigFloat, Float32}
58+
@testset "Bad CuArray eltype" begin
59+
@test_throws ErrorException CuArray{MyBadType, 1}(undef, 64)
60+
@test_throws ErrorException CuArray{MyBadType2, 1}(undef, 64)
61+
end
62+
5463
@testset "synchronization" begin
5564
a = CUDA.zeros(2, 2)
5665
synchronize(a)

0 commit comments

Comments
 (0)