This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Introduce more atomic operations into the runtime
ClosedPublic

Authored by jdoerfert on Oct 2 2022, 9:49 AM.

Diff Detail

Event Timeline

jdoerfert created this revision.Oct 2 2022, 9:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2022, 9:49 AM
jdoerfert requested review of this revision.Oct 2 2022, 9:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2022, 9:49 AM
Herald added a subscriber: sstefan1. · View Herald Transcript

I think it's worth to create a new file Atomic.cpp.

openmp/libomptarget/DeviceRTL/src/Synchronization.cpp
93

the indent is off here

106

This doesn't look right. The integer value after type punning doesn't conform with the same arithmetic as the original floating-point value. Actually we already have atomicrmw fmax/fmin in LLVM.

tianshilei1992 added inline comments.Oct 3 2022, 2:16 PM
openmp/libomptarget/DeviceRTL/src/Synchronization.cpp
106

and we should also have the corresponding compiler builtins.

tianshilei1992 accepted this revision.Oct 4 2022, 7:35 AM

LGTM

openmp/libomptarget/DeviceRTL/src/Synchronization.cpp
93

nvm

106

okay, currently clang doesn't support the floating-point builtins yet. One alternative is to use OpenMP atomic directive here, but I'm also fine if the currently scheme could work. We can revisit this part later when we have the support in the compiler.

This revision is now accepted and ready to land.Oct 4 2022, 7:35 AM
jdoerfert updated this revision to Diff 465082.Oct 4 2022, 11:01 AM
jdoerfert marked 2 inline comments as done.

Update

This revision was landed with ongoing or failed builds.Oct 4 2022, 8:21 PM
This revision was automatically updated to reflect the committed changes.