Skip to content

Commit

Permalink
bugfix atomics
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Nov 9, 2023
1 parent ca329ff commit 714e219
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/atomic.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Atomic opterations

const atomic_ops = ((:add!, :+), (:sub!, :-), (:min!, :min), (:max!, :max),
const ATOMIC_OPS = ((:add!, :+), (:sub!, :-), (:min!, :min), (:max!, :max),
(:and!, :&), (:or!, :|), (:xor!, :xor))

# Methods for writing to a `WriteMode` `GridData` grid with threading. These are
# associative and commutative so that write order does not affect the result.
for (f, op) in atomic_ops
for (f, op) in ATOMIC_OPS
@eval begin
@propagate_inbounds ($f)(d::AbstractSimData, x, I...) = ($f)(first(d), x, I...)
@propagate_inbounds ($f)(d::GridData{<:WriteMode,<:Any,R}, x, I...) where R = ($f)(d, proc(d), x, I...)
Expand Down

0 comments on commit 714e219

Please sign in to comment.