# LoadError: @atomic modify expression missing field access

**URL:** <https://discourse.julialang.org/t/loaderror-atomic-modify-expression-missing-field-access/93973>\
**Category:** GPU\
**Created:** [February 3, 2023, 8:01am UTC](https://discourse.julialang.org/t/loaderror-atomic-modify-expression-missing-field-access/93973 "2023-02-03T08:01:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcsj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bcsj/32/18526_2.png) [@bcsj](https://discourse.julialang.org/u/bcsj)\
**Post date:** [February 3, 2023, 8:01am UTC](https://discourse.julialang.org/t/loaderror-atomic-modify-expression-missing-field-access/93973/1 "2023-02-03T08:01:45Z")

</div>

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](https://github.com/maleadt/juliacon21-gpu_workshop/blob/main/src/sum_single_int32.jl)

---

<div class="post-metadata">

**Author:** ![bcsj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bcsj/32/18526_2.png) [@bcsj](https://discourse.julialang.org/u/bcsj)\
**Post date:** [February 3, 2023, 8:18am UTC](https://discourse.julialang.org/t/loaderror-atomic-modify-expression-missing-field-access/93973/2 "2023-02-03T08:18:35Z")

</div>

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.
