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 30, 2024
1 parent 08d36f8 commit 6f99e33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ArrayInterface = "7.10"
CEnum = "0.4, 0.5"
Cassette = "0.3"
Enzyme = "0.11, 0.12"
NNlib = "0.9.17"
NNlib = "0.9"
Preferences = "1.4"
Reactant_jll = "0.0.6"
julia = "1"
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 6f99e33

Please sign in to comment.