We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf6c2e1 commit 904d103Copy full SHA for 904d103
src/testsuite/construction.jl
@@ -61,6 +61,34 @@ function constructors(AT)
61
@test eltype(B) == T
62
end
63
64
+ @testset "comparison against Array" begin
65
+ for typs in [(), (Int,), (Int,1), (Int,2), (Float32,), (Float32,1), (Float32,2)],
66
+ args in [(), (1,), (1,2), ((1,),), ((1,2),),
67
+ (undef,), (undef, 1,), (undef, 1,2), (undef, (1,),), (undef, (1,2),),
68
+ (Int,), (Int, 1,), (Int, 1,2), (Int, (1,),), (Int, (1,2),),
69
+ ([1,2],), ([1 2],)]
70
+ cpu = try
71
+ Array{typs...}(args...)
72
+ catch ex
73
+ isa(ex, MethodError) || rethrow()
74
+ nothing
75
+ end
76
+
77
+ gpu = try
78
+ AT{typs...}(args...)
79
80
81
+ cpu == nothing || rethrow()
82
83
84
85
+ if cpu == nothing
86
+ @test gpu == nothing
87
+ else
88
+ @test typeof(cpu) == typeof(convert(Array, gpu))
89
90
91
92
93
94
function conversion(AT)
0 commit comments