struct GV

Declaration

struct GV { /* full declaration omitted */ };

Description

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

Declared at: llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h:57

Member Variables

public const unsigned int GV_Slot_Size
The size reserved for data in a shared memory slot.
public const unsigned int GV_Warp_Size
The default value of maximum number of threads in a worker warp.
public const unsigned int GV_Max_Teams
the maximum number of teams.
public const unsigned int GV_SimpleBufferSize
public const unsigned int GV_Max_WG_Size
public const unsigned int GV_Default_WG_Size

Method Overview

Methods

constexpr unsigned int maxWarpNumber() const

Declared at: llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h:78

constexpr unsigned int warpSlotSize() const

Declared at: llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h:63