This is an archive of the discontinued LLVM Phabricator instance.

[openmp][amdgpu] Initial gfx10 offloading implementation
ClosedPublic

Authored by JonChesterfield on Aug 25 2021, 9:10 AM.

Details

Summary

Lets wavefront size be 32 for amdgpu openmp, as well as 64.

Fixes up as little as possible to pass that through the libraries. This change
is end to end, as opposed to updating clang/devicertl/plugin separately. It can
be broken up for review/commit if preferred. Posting as-is so that others with
a gfx10 can try it out. It works roughly as well as gfx9 for me, but there are
probably bugs remaining as well as the todo: for letting grid values vary more.

Diff Detail

Event Timeline

JonChesterfield requested review of this revision.Aug 25 2021, 9:10 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptAug 25 2021, 9:10 AM
llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h
102

Want to resolve this at compile time for the deviceRTL. Hoping to think of a prettier way to spell it. Currently all but one field are the same for the two, that's probably suboptimal for performance.

openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
111

I've got a gfx1010 locally and @dpalermo has a gfx1031

openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h
40

compiling for device code means a macro is available to pick between the two

ronlieb added inline comments.Aug 27 2021, 4:07 AM
openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
111

gfx1030 is also valid, please add

  • uint32 to unsigned
JonChesterfield marked an inline comment as done.Aug 27 2021, 4:10 AM
JonChesterfield added a subscriber: dhruvachak.
JonChesterfield added inline comments.
openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
111

we think @dhruvachak has a 1030, added

JonChesterfield marked an inline comment as done.Aug 27 2021, 4:10 AM
JonChesterfield added inline comments.
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
1920

This part is strictly a bugfix - previously we printed the default wave size, now we print the one that is in use

ronlieb accepted this revision.Aug 27 2021, 4:31 AM

since amdgpu buildbots are red, at Jon's request, i applied patch on latest trunk build.
applies clean, builds fine, no additional regressions in bheck-openmp

compiler now accepts -march=gfx1030 and gfx1031

This revision is now accepted and ready to land.Aug 27 2021, 4:31 AM
This revision was landed with ongoing or failed builds.Aug 27 2021, 4:34 AM
This revision was automatically updated to reflect the committed changes.