We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48bf9b7 commit 2341a8bCopy full SHA for 2341a8b
src/blas.jl
@@ -42,8 +42,9 @@ end
42
Base.scale!(s::Real, X::GPUArray) = scale!(X, s)
43
function Base.scale!(X::GPUArray{T}, s::Real) where T <: BLAS.BlasComplex
44
R = typeof(real(zero(T)))
45
- buff = reinterpret(R, vec(X))
46
- BLAS.scal!(2*length(X), R(s), buff, 1)
+ N = 2*length(X)
+ buff = unsafe_reinterpret(R, X, (N,))
47
+ BLAS.scal!(N, R(s), buff, 1)
48
X
49
end
50
function Base.scale!(X::GPUArray{T}, s::Real) where T <: Union{Float32, Float64}
0 commit comments