File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 66
66
67
67
cpu (m) = fmap (x -> adapt (Array, x), m)
68
68
69
- gpu (x) = use_cuda[] ? fmap (CUDA. cu, x) : x
69
+ _isbitsarray (:: AbstractArray{<:Number} ) = true
70
+ _isbitsarray (:: AbstractArray{T} ) where T = isbitstype (T)
71
+ _isbitsarray (x) = false
72
+ gpu (x) = use_cuda[] ? fmap (CUDA. cu, x; exclude = _isbitsarray) : x
70
73
71
74
# Precision
72
75
Original file line number Diff line number Diff line change 73
73
Q_cpu = Q_gpu |> cpu
74
74
@test Q_cpu == cholesky (eltype (Q_gpu).(M))
75
75
end
76
+
77
+ @testset " isbits array types" begin
78
+ struct SimpleBits
79
+ field:: Int32
80
+ end
81
+
82
+ @test gpu ((;a= ones (1 ))). a isa CuVector{Float32}
83
+ @test gpu ((;a= [' a' , ' b' , ' c' ])). a isa CuVector{Char}
84
+ @test gpu ((;a= [SimpleBits (1 )])). a isa CuVector{SimpleBits}
85
+ end
76
86
end
You can’t perform that action at this time.
0 commit comments