LLVM: llvm::omp::GV Struct Reference (original) (raw)
Defines various target-specific GPU grid values that must be consistent between host RTL (plugin), device RTL, and clang. More...
Defines various target-specific GPU grid values that must be consistent between host RTL (plugin), device RTL, and clang.
We can change grid values for a "fat" binary so that different passes get the correct values when generating code for a multi-target binary. Both amdgcn and nvptx values are stored in this file. In the future, should there be differences between GPUs of the same architecture, then simply make a different array and use the new array name.
Example usage in clang: const unsigned slot_size = ctx.GetTargetInfo().getGridValue().GV_Warp_Size;
Example usage in libomptarget/deviceRTLs: #include "llvm/Frontend/OpenMP/OMPGridValues.h" #ifdef AMDGPU #define GRIDVAL AMDGPUGridValues else #define GRIDVAL NVPTXGridValues #endif ... Then use this reference for GV_Warp_Size in the deviceRTL source. llvm::omp::GRIDVAL().GV_Warp_Size
Example usage in libomptarget hsa plugin: #include "llvm/Frontend/OpenMP/OMPGridValues.h" #define GRIDVAL AMDGPUGridValues ... Then use this reference to access GV_Warp_Size in the hsa plugin. llvm::omp::GRIDVAL().GV_Warp_Size
Example usage in libomptarget cuda plugin: #include "llvm/Frontend/OpenMP/OMPGridValues.h" #define GRIDVAL NVPTXGridValues ... Then use this reference to access GV_Warp_Size in the cuda plugin. llvm::omp::GRIDVAL().GV_Warp_Size
Definition at line 57 of file OMPGridValues.h.