Skip to content

Commit 1cacfdf

Browse files
authored
Merge pull request #348 from JuliaGPU/tb/adapt_array
Don't add a public adapt method for Array.
2 parents 6fc376f + 15c77f8 commit 1cacfdf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/host/abstractarray.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ end
4141

4242
## convert to CPU (keeping wrapper type)
4343

44-
Adapt.adapt_storage(::Type{<:Array}, xs::AbstractArray) = convert(Array, xs)
45-
convert_to_cpu(xs) = adapt(Array, xs)
44+
struct ToArray end
45+
46+
Adapt.adapt_storage(::ToArray, xs::AbstractArray) = convert(Array, xs)
47+
convert_to_cpu(xs) = adapt(ToArray(), xs)
4648

4749
## showing
4850

0 commit comments

Comments
 (0)