Skip to content

Commit

Permalink
Merge pull request #19 from darsnack/kd/fix-@atomic
Browse files Browse the repository at this point in the history
Use `CUDA.@atomic`
  • Loading branch information
DhairyaLGandhi authored Jul 2, 2021
2 parents 7577b98 + 2ce8a27 commit af81ef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/CUDAExt/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function divide_kernel!(xs, counts, max_idx, max_dims_idx, dims_size)
@inbounds if index <= max_idx
j, k = divrem(index-1, max_dims_idx)
dims_i = Tuple(CartesianIndices(dims_size)[k+1])
@atomic xs[dims_i..., j+1] = xs[dims_i..., j+1] / counts[j+1]
CUDA.@atomic xs[dims_i..., j+1] = xs[dims_i..., j+1] / counts[j+1]
end
return nothing
end
Expand Down

0 comments on commit af81ef6

Please sign in to comment.