Taichi splits kernel in several for loops? #7303
-
I'm trying to add all elements in the field
Apologies if this question seems a bit smooth brained, I just got no clue whats going on here... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Because Taichi for loop is parallel, when you do += it's doing an atomic add so summation will work over parallel loop. However keep in mind in parallelized loops, the order of execution in the loop is considered random. Thus the value you read from sum[None] will appear in a random order |
Beta Was this translation helpful? Give feedback.
Because Taichi for loop is parallel, when you do += it's doing an atomic add so summation will work over parallel loop. However keep in mind in parallelized loops, the order of execution in the loop is considered random. Thus the value you read from sum[None] will appear in a random order