Skip to content

Commit

Permalink
Use CUDA.@atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
darsnack committed Jul 2, 2021
1 parent 7577b98 commit 2ce8a27
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 2ce8a27

Please sign in to comment.