[PATCH] D83492: [OpenMP] Use common interface to access GPU Grid Values

Saiyedul Islam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 13 14:55:23 PDT 2020


saiislam added a comment.

In D83492#2142086 <https://reviews.llvm.org/D83492#2142086>, @JonChesterfield wrote:

> 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.


Here is an implementation: D83723 <https://reviews.llvm.org/D83723> . It also provides target specific implementation of getNVPTXWarpSize() as proof of concept.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83492/new/

https://reviews.llvm.org/D83492





More information about the cfe-commits mailing list