Skip to content

Commit

Permalink
Add copyto!
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed May 27, 2024
1 parent 08d36f8 commit 3ec8739
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,12 @@ Cassette.overdub(context::TraceCtx, f::typeof(Base.materialize!), args...) = f(a
@inline Base.copyto!(dest::TracedRArray, bc::Broadcasted{Nothing}) =
_copyto!(dest, bc) # Keep it for ArrayConflict

@inline function Base.copyto!(dest::TracedRArray{ElType, Shape, N},
src::TracedRArray{ElType, Shape, N}) where {ElType, Shape, N}
dest.mlir_data = src.mlir_data
return dest
end

@inline function broadcast_to_size(arg::AbstractArray, rsize)
attr = MLIR.IR.DenseElementsAttribute(arg)
len = ndims(arg)
Expand Down

0 comments on commit 3ec8739

Please sign in to comment.