Skip to content

Commit a3c1d6d

Browse files
committed
Try to exted map_fields_recursive for MixedDuplicated
1 parent f7ec291 commit a3c1d6d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/EnzymeTestUtils/src/generate_tangent.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ function map_fields_recursive(f, x::T...) where {T<:Union{Array,Tuple,NamedTuple
1515
map_fields_recursive(f, xi...)
1616
end
1717
end
18+
function map_fields_recursive(f::typeof(Base.copyto!), x::Base.RefValue{T}, y::T) where {T}
19+
x[] = y
20+
return x
21+
end
22+
1823
function map_fields_recursive(f::typeof(Base.copyto!), y::T, x::T) where {T<:LinearAlgebra.HermOrSym{<:Number}}
1924
copyto!(x.uplo == 'U' ? UpperTriangular(parent(y)) : LowerTriangular(parent(y)), x.uplo == 'U' ? UpperTriangular(parent(x)) : LowerTriangular(parent(x)))
2025
return y

0 commit comments

Comments
 (0)