Guest User

Untitled

a guest
Jan 19th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. In Julia, accomplish reduction syntax
  2.  
  3. ```julia
  4. s = Atomic{Float64}(0.0)
  5. @threads for id in 1:4
  6. tmpsum = 0.0
  7. for i in (id-1)*25+1:id*25
  8. tmpsum += a[i]
  9. end
  10. atomic_add!(s, tmpsum)
  11. end
  12. ```
Add Comment
Please, Sign In to add comment