Skip to content

Commit 5abd171

Browse files
committed
Implement copyto!
1 parent 66208dd commit 5abd171

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/host/construction.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ end
3838

3939
(T::Type{<: AbstractGPUArray})(s::UniformScaling, m::Integer, n::Integer) = T(s, Dims((m, n)))
4040

41+
function Base.copyto!(A::AbstractGPUMatrix{T}, s::UniformScaling) where T
42+
fill!(A, zero(T))
43+
gpu_call(uniformscaling_kernel, A, size(A, 1), s; total_threads=minimum(size(A)))
44+
A
45+
end
46+
4147
function indexstyle(x::T) where T
4248
style = try
4349
Base.IndexStyle(x)

0 commit comments

Comments
 (0)