|
52 | 52 |
|
53 | 53 | ## showing
|
54 | 54 |
|
| 55 | +Adapt.adapt_storage(::Type{<:Array}, xs::AbstractArray) = convert(Array, xs) |
| 56 | +cpu(xs) = adapt(Array, xs) |
| 57 | + |
55 | 58 | for (W, ctor) in (:AT => (A,mut)->mut(A), Adapt.wrappers...)
|
56 | 59 | @eval begin
|
57 | 60 | # display
|
58 |
| - Base.print_array(io::IO, X::$W where {AT <: GPUArray}) = Base.print_array(io, $ctor(X, Array)) |
| 61 | + Base.print_array(io::IO, X::$W where {AT <: GPUArray}) = Base.print_array(io, $ctor(X, cpu)) |
59 | 62 |
|
60 | 63 | # show
|
61 | 64 | Base._show_nonempty(io::IO, X::$W where {AT <: GPUArray}, prefix::String) =
|
62 |
| - Base._show_nonempty(io, $ctor(X, Array), prefix) |
| 65 | + Base._show_nonempty(io, $ctor(X, cpu), prefix) |
63 | 66 | Base._show_empty(io::IO, X::$W where {AT <: GPUArray}) =
|
64 |
| - Base._show_empty(io, $ctor(X, Array)) |
| 67 | + Base._show_empty(io, $ctor(X, cpu)) |
65 | 68 | Base.show_vector(io::IO, v::$W where {AT <: GPUArray}, args...) =
|
66 |
| - Base.show_vector(io, $ctor(v, Array), args...) |
| 69 | + Base.show_vector(io, $ctor(v, cpu), args...) |
67 | 70 | end
|
68 | 71 | end
|
69 | 72 |
|
|
0 commit comments