Skip to content

Vector transpose #238

@maleadt

Description

@maleadt
julia> using LinearAlgebra

julia> a = [1 2]
1×2 Array{Int64,2}:
 1  2

julia> b = [1, 2]
2-element Array{Int64,1}:
 1
 2

julia> transpose!(a, b)
1×2 Array{Int64,2}:
 1  2

julia> transpose!(b, a)
2-element Array{Int64,1}:
 1
 2

vs

julia> using GPUArrays.JLArrays

julia> transpose!(JLArray(a), JLArray(b))
ERROR: MethodError: no method matching transpose_f!(::typeof(transpose), ::JLArray{Int64,2}, ::JLArray{Int64,1})
Closest candidates are:
  transpose_f!(::Any, ::AbstractGPUArray{T,2}, ::AbstractGPUArray{T,2}) where T at /home/tim/Julia/pkg/GPUArrays/src/host/linalg.jl:6
Stacktrace:
 [1] transpose!(::JLArray{Int64,2}, ::JLArray{Int64,1}) at /home/tim/Julia/pkg/GPUArrays/src/host/linalg.jl:14
 [2] top-level scope at REPL[9]:1

julia> transpose!(JLArray(b), JLArray(a))
ERROR: MethodError: no method matching transpose_f!(::typeof(transpose), ::JLArray{Int64,1}, ::JLArray{Int64,2})
Closest candidates are:
  transpose_f!(::Any, ::AbstractGPUArray{T,2}, ::AbstractGPUArray{T,2}) where T at /home/tim/Julia/pkg/GPUArrays/src/host/linalg.jl:6
Stacktrace:
 [1] transpose!(::JLArray{Int64,1}, ::JLArray{Int64,2}) at /home/tim/Julia/pkg/GPUArrays/src/host/linalg.jl:14
 [2] top-level scope at REPL[10]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions