You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am on Julia 1.9.0, Enzyme 9487eb8 and StaticArrays v1.5.25. Apologies for the slightly strange example. This errors:
using Enzyme, StaticArrays
vector_1D(c1, c2, side_length) = c2 - c1
functionf!(pe_vec, coords, boundary, n_threads, ::Val{T}) where T
pe_sum =zero(T)
if n_threads >1# This branch is not taken but the code in it still causes problems
pe_sum_chunks = [zero(T) for _ in1:n_threads]
Threads.@threadsfor thread_id in1:n_threads
dr =vector_1D.(c1, c2, boundary)
pe_sum_chunks[thread_id] +=sum(dr)
end
pe_sum +=sum(pe_sum_chunks)
end
pe_vec[1] = pe_sum
returnnothingend
T = Float32
pe_vec = [zero(T)]
coords = [SVector(T(1.0), T(1.0), T(1.0)), SVector(T(2.0), T(2.0), T(2.0))]
boundary =SVector(T(4.0), T(4.0), T(4.0))
n_threads =1autodiff(
Enzyme.Reverse,
f!,
Const,
Duplicated(pe_vec, [one(T)]),
Duplicated(coords, zero(coords)),
Const(boundary),
Const(n_threads),
Const(Val(T)),
)
I am on Julia 1.9.0, Enzyme 9487eb8 and StaticArrays v1.5.25. Apologies for the slightly strange example. This errors:
Any of the following removes the error:
T = Float64
instead.Threads.@threads
in the loop.boundary
in thevector_1D
function.c1 - c2
instead ofvector_1D.(c1, c2, boundary)
.The text was updated successfully, but these errors were encountered: