You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dot products of CuArrays and Arrays fail with: ERROR: LoadError: ArgumentError: cannot take the CPU address of a CuArray{Float64,1}. Same with Float64. Same with CUDA.dot.
It's hard to tell if this is related / the same as an existing open issue.
To reproduce
dot(ones(Float64, 3), CUDA.ones(Float64, 3))
ERROR: ArgumentError: cannot take the CPU address of a CuArray{Float64, 1}
Stacktrace:
[1] unsafe_convert(#unused#::Type{Ptr{Float64}}, x::CuArray{Float64, 1})
@ CUDA ~/.julia/packages/CUDA/OOtNT/src/array.jl:211
[2] dot(n::Int64, DX::Vector{Float64}, incx::Int64, DY::CuArray{Float64, 1}, incy::Int64)
@ LinearAlgebra.BLAS ~/julia-master/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/blas.jl:394
[3] dot(DX::Vector{Float64}, DY::CuArray{Float64, 1})
@ LinearAlgebra.BLAS ~/julia-master/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/blas.jl:443
[4] dot(x::Vector{Float64}, y::CuArray{Float64, 1})
@ LinearAlgebra ~/julia-master/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/matmul.jl:9
[5] top-level scope
@ REPL[8]:1
Additional context
The generic fallback is hit when the float types are different. This succeeds, unless CuArrays.allowscalar(false) is set:
dot(ones(Float64, 3), CUDA.ones(Float32, 3))
┌ Warning: Performing scalar operations on GPU arrays: This is very slow, consider disallowing these operations with `allowscalar(false)`
└ @ GPUArrays ~/.julia/packages/GPUArrays/jhRU7/src/host/indexing.jl:43
3.0
This is expected behavior. You're dispatching to the CPU BLAS implementation, which attempts to take a CPU pointer of its arguments. The fact that this differs depending on the types is a property of the Base implementation. Mixing array types is generally not supported.
Describe the bug
Dot products of
CuArray
s andArray
s fail with:ERROR: LoadError: ArgumentError: cannot take the CPU address of a CuArray{Float64,1}
. Same withFloat64
. Same withCUDA.dot
.It's hard to tell if this is related / the same as an existing open issue.
To reproduce
Additional context
The generic fallback is hit when the float types are different. This succeeds, unless
CuArrays.allowscalar(false)
is set:Manifest.toml
Expected behavior
Return 3.0
Version info
Details on Julia:
Details on CUDA:
The text was updated successfully, but these errors were encountered: