Use common interface for accessing target specific GPU grid values in NVPTX
OpenMP codegen as proposed in https://reviews.llvm.org/D80917
Originally authored by Greg Rodgers (@gregrodgers).
Differential D83492
[OpenMP] Use common interface to access GPU Grid Values saiislam on Jul 9 2020, 9:56 AM. Authored by
Details Use common interface for accessing target specific GPU grid values in NVPTX Originally authored by Greg Rodgers (@gregrodgers).
Diff Detail
Event TimelineComment Actions Changing to getGridValue would be useful for sharing parts of this with amdgcn. The aomp toolchain handles codegen for amdgcn by adding if (isAMDGCN) to this file. Until such time as tregions obsoletes this code, I think we should go with layers instead of scattered conditionals. I.e. rename CGOpenMPRuntimeNVPTX to CGOpenMPRuntimeGPU which contains code that is common to nvptx and amdgcn. That probably uses getGridValue() as a way to abstract over minor differences. Derive CGOpenMPRuntimeAMDGCN and CGOpenMPRuntimeNVPTX from CGOpenMPRuntimeGPU to implement (virtual) functions which are different between the two.
Comment Actions Here is an implementation: D83723 . It also provides target specific implementation of getNVPTXWarpSize() as proof of concept.
|