https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120737
Benjamin Schulz <schulz.benjamin at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #61673|0 |1 is obsolete| | --- Comment #1 from Benjamin Schulz <schulz.benjamin at googlemail dot com> --- Created attachment 61674 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61674&action=edit main.cpp compile with -g -O3 -fopenmp -foffload=nvptx-none -fno-stack-protector -std=c++23 -lm -lc If one replaces the last #pragma omp target parallel for shared(tmp) #pragma omp parallel for shared(tmp) Then the omp critical statement is working and yielding the correct result 2740. Similarly, omp atomic does not work correctly on the target in this example. With target distribute it is the same. Strangely, however,a reduction clause works instead, even if not supported with target distribute by the standard officiallly... But one still should have critical and atomic working correctly with shared variables on the target...