This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget][nfc] Add declarations of atomic functions for amdgcn
ClosedPublic

Authored by JonChesterfield on Dec 12 2019, 4:54 AM.

Details

Summary

[libomptarget][nfc] Add declarations of atomic functions for amdgcn

This enables building more source for amdgcn. The functions are usually available
in a hip runtime header, but are duplicated here to decouple the implementation

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2019, 4:54 AM
jdoerfert accepted this revision.Dec 12 2019, 10:53 AM

LGTM. See my comments below.

openmp/libomptarget/deviceRTLs/amdgcn/src/hip_atomics.h
9

Header guards should be useful here.

35

One could have opted for a template solution but this is fine too.

This revision is now accepted and ready to land.Dec 12 2019, 10:53 AM
  • add header guards
JonChesterfield marked 3 inline comments as done.Dec 12 2019, 2:54 PM
JonChesterfield added inline comments.
openmp/libomptarget/deviceRTLs/amdgcn/src/hip_atomics.h
9

Agreed, sloppy to miss them out here. Fixed.

35

This looks ugly in the header but has the attraction of mapping 1:1 onto functions defined in the support library, which may not want to implement them as explicit instantiations.

This revision was automatically updated to reflect the committed changes.
JonChesterfield marked an inline comment as done.