Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ext/StridedGPUArraysExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module StridedGPUArraysExt

using Strided, GPUArrays
using Strided, GPUArrays, LinearAlgebra
using GPUArrays: Adapt, KernelAbstractions
using GPUArrays.KernelAbstractions: @kernel, @index

Expand All @@ -20,6 +20,14 @@ function Base.copy!(dst::AbstractArray{TD, ND}, src::StridedView{TS, NS, TAS, FS
return dst
end

function Base.copyto!(dest::StridedView{T, N, <:AnyGPUArray{T}}, bc::Base.Broadcast.Broadcasted{Strided.StridedArrayStyle{N}}) where {T <: Number, N}
dims = size(dest)
any(isequal(0), dims) && return dest

GPUArrays._copyto!(dest, bc)
return dest
end

# lifted from GPUArrays.jl
function Base.fill!(A::StridedView{T, N, TA, F}, x) where {T, N, TA <: AbstractGPUArray{T}, F <: ALL_FS}
isempty(A) && return A
Expand All @@ -34,7 +42,7 @@ function Base.fill!(A::StridedView{T, N, TA, F}, x) where {T, N, TA <: AbstractG
return A
end

function Strided.__mul!(
function LinearAlgebra.mul!(
C::StridedView{TC, 2, <:AnyGPUArray{TC}},
A::StridedView{TA, 2, <:AnyGPUArray{TA}},
B::StridedView{TB, 2, <:AnyGPUArray{TB}},
Expand Down
Loading