Skip to content

Commit

Permalink
More 1.11 debugging (#2007)
Browse files Browse the repository at this point in the history
* More 1.11 debugging

* fix shadow

* fix
  • Loading branch information
wsmoses authored Oct 23, 2024
1 parent 820c005 commit 064e65c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/make_zero.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ else
end

@inline function EnzymeCore.make_zero!(
prev::Array{GenericMemory, Complex{T}},
prev::GenericMemory{kind, Complex{T}},
seen::ST,
)::Nothing where {T<:AbstractFloat,kind,ST}
fill!(prev, zero(Complex{T}))
Expand Down
11 changes: 11 additions & 0 deletions src/rules/llvmrules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ function arraycopy_common(fwd, B, orig, shadowsrc, gutils, shadowdst; len=nothin
algn = 0
i8 = LLVM.IntType(8)

shadowsrcs = LLVM.Value[]
shadowdsts = LLVM.Value[]

for i = 1:width

evsrc = if width == 1
Expand Down Expand Up @@ -691,6 +694,14 @@ function arraycopy_common(fwd, B, orig, shadowsrc, gutils, shadowdst; len=nothin
LLVM.memset!(B, shadowdst0, LLVM.ConstantInt(i8, 0, false), length, algn)
end

push!(shadowsrcs, shadowsrc0)
push!(shadowdsts, shadowdst0)
end

for i in 1:width
shadowsrc0 = shadowsrcs[i]
shadowdst0 = shadowdsts[i]

API.sub_transfer(
gutils,
fwd ? API.DEM_ReverseModePrimal : API.DEM_ReverseModeGradient,
Expand Down

0 comments on commit 064e65c

Please sign in to comment.