Skip to content

Commit

Permalink
Fix JuliaDiff#714: Make TAGCOUNT always greater than the last instant…
Browse files Browse the repository at this point in the history
…iated Tag's count
  • Loading branch information
Technici4n committed Nov 18, 2024
1 parent 3acc8a6 commit 4cb3336
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const TAGCOUNT = Threads.Atomic{UInt}(0)
end

function Tag(f::F, ::Type{V}) where {F,V}
tagcount(Tag{F,V}) # trigger generated function
count = tagcount(Tag{F,V}) # trigger generated function
# make sure inner derivatives have a higher count even if this Tag instantiation was precompiled; fixes #714
Threads.atomic_max!(TAGCOUNT, count+1)
Tag{F,V}()
end

Expand Down

0 comments on commit 4cb3336

Please sign in to comment.