LoadError: @atomic modify expression missing field access

I’ve been trying to write a reduction kernel using [1] as a blueprint to work from, but I kept getting this error message:

LoadError: @atomic modify expression missing field access

I couldn’t understand why, and in the end I downloaded the specific code in [1] as a test and tried to run it, which gives me the same error.

Can anyone explain to me what is going on?

[1] https://github.com/maleadt/juliacon21-gpu_workshop/blob/main/src/sum_single_int32.jl

After some more searching around I found a comment that Julia was going to add its own native @atomic macro in some version. I realized this might be the issue and replaced @atomic with CUDA.@atomic in the codes. They now all work for me.

1 Like