Skip to content

Commit 1bcd193

Browse files
committed
cleanup printing
1 parent 05fea1a commit 1bcd193

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

src/abstractarray.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ struct LocalMemory{T} <: GPUArray{T, 1}
1616
LocalMemory{T}(x::Integer) where T = new{T}(x)
1717
end
1818

19-
#=
20-
AbstractArray interface
21-
=#
22-
23-
function Base.show(io::IO, A::GPUArray)
24-
print(io, "GPU: ")
25-
Base.show(io, Array(A), repr)
26-
end
27-
28-
2919
############################################
3020
# serialization
3121
import Serialization: AbstractSerializer, serialize, deserialize, serialize_type

src/array.jl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,9 @@ pointer(x::JLArray) = pointer(x.data)
3030

3131

3232
## I/O
33-
34-
Base.show(io::IO, x::JLArray) = show(io, collect(x))
35-
Base.show(io::IO, x::LinearAlgebra.Adjoint{<:Any,<:JLArray}) = show(io, LinearAlgebra.adjoint(collect(x.parent)))
36-
Base.show(io::IO, x::LinearAlgebra.Transpose{<:Any,<:JLArray}) = show(io, LinearAlgebra.transpose(collect(x.parent)))
37-
38-
Base.show(io::IO, ::MIME"text/plain", x::JLArray) = show(io, MIME"text/plain"(), collect(x))
39-
Base.show(io::IO, ::MIME"text/plain", x::LinearAlgebra.Adjoint{<:Any,<:JLArray}) = show(io, MIME"text/plain"(), LinearAlgebra.adjoint(collect(x.parent)))
40-
Base.show(io::IO, ::MIME"text/plain", x::LinearAlgebra.Transpose{<:Any,<:JLArray}) = show(io, MIME"text/plain"(), LinearAlgebra.transpose(collect(x.parent)))
41-
33+
Base.print_array(io::IO, x::GPUArray) = Base.print_array(io, collect(x))B
34+
Base.print_array(io::IO, x::LinearAlgebra.Adjoint{<:Any,<:GPUArray}) = Base.print_array(io, LinearAlgebra.adjoint(collect(x.parent)))
35+
Base.print_array(io::IO, x::LinearAlgebra.Transpose{<:Any,<:GPUArray}) = Base.print_array(io, LinearAlgebra.transpose(collect(x.parent)))
4236

4337
## other
4438

0 commit comments

Comments
 (0)