0

I want to use floor/ceil functions of C in an OpenACC project. When I want to make an atomic update of a value.

#pragma acc atomic update
x=floor(x)+c

the compiler shows the following message:

PGCC-S-0155-Invalid atomic expression PGCC-S-0155-Invalid atomic region.

What could be the problem?

1 Answers1

0

Atomic operations are for simple and straightforward operations like +, -, *, and /. If you take a look at the Section 2.12 (Atomic Construct) of the OpenACC Spec Page 42 [link], you will see the list of available operations to use in atomic construct.

So, although you could do floor on GPU, you cannot do it in atomic sections.

mgNobody
  • 738
  • 7
  • 23