LLVM  14.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::omp::GV Struct Reference

Defines various target-specific GPU grid values that must be consistent between host RTL (plugin), device RTL, and clang. More...

#include "llvm/Frontend/OpenMP/OMPGridValues.h"

Collaboration diagram for llvm::omp::GV:
Collaboration graph
[legend]

Public Member Functions

constexpr unsigned warpSlotSize () const
 
constexpr unsigned maxWarpNumber () const
 

Public Attributes

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

Detailed 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

Definition at line 57 of file OMPGridValues.h.

Member Function Documentation

◆ maxWarpNumber()

constexpr unsigned llvm::omp::GV::maxWarpNumber ( ) const
inlineconstexpr

Definition at line 78 of file OMPGridValues.h.

References GV_Max_WG_Size, and GV_Warp_Size.

◆ warpSlotSize()

constexpr unsigned llvm::omp::GV::warpSlotSize ( ) const
inlineconstexpr

Definition at line 63 of file OMPGridValues.h.

References GV_Slot_Size, and GV_Warp_Size.

Member Data Documentation

◆ GV_Default_WG_Size

const unsigned llvm::omp::GV::GV_Default_WG_Size

Definition at line 76 of file OMPGridValues.h.

◆ GV_Max_Teams

const unsigned llvm::omp::GV::GV_Max_Teams

the maximum number of teams.

Definition at line 68 of file OMPGridValues.h.

◆ GV_Max_WG_Size

const unsigned llvm::omp::GV::GV_Max_WG_Size

Definition at line 74 of file OMPGridValues.h.

Referenced by maxWarpNumber().

◆ GV_SimpleBufferSize

const unsigned llvm::omp::GV::GV_SimpleBufferSize

Definition at line 72 of file OMPGridValues.h.

◆ GV_Slot_Size

const unsigned llvm::omp::GV::GV_Slot_Size

The size reserved for data in a shared memory slot.

Definition at line 59 of file OMPGridValues.h.

Referenced by warpSlotSize().

◆ GV_Warp_Size

const unsigned llvm::omp::GV::GV_Warp_Size

The default value of maximum number of threads in a worker warp.

Definition at line 61 of file OMPGridValues.h.

Referenced by maxWarpNumber(), and warpSlotSize().


The documentation for this struct was generated from the following file: