clang 24.0.0git
clang::OffloadArch Class Reference

A processor an offloading action can target. More...

#include "clang/Basic/OffloadArch.h"

Public Types

enum class  TargetArch : uint8_t {
  Unused , Unknown , NVPTX , AMDGPU ,
  SPIRV , IntelCPU , IntelGPU , Generic
}
enum class  IntelArch : uint32_t { GRANITERAPIDS , BMG_G21 }

Public Member Functions

constexpr OffloadArch ()=default
TargetArch targetArch () const
bool isNVPTX () const
bool isAMDGPU () const
bool isSPIRV () const
bool isIntelCPU () const
bool isIntelGPU () const
bool isIntel () const
bool isGeneric () const
bool isUnused () const
bool isUnknown () const
llvm::NVPTX::GPUKind nvptxKind () const
llvm::AMDGPU::GPUKind amdgpuKind () const
bool operator== (const OffloadArch &Other) const
bool operator!= (const OffloadArch &Other) const
bool operator< (const OffloadArch &Other) const

Static Public Member Functions

static OffloadArch getNVPTX (llvm::NVPTX::GPUKind K)
static OffloadArch getAMDGPU (llvm::AMDGPU::GPUKind K)
static constexpr OffloadArch getIntel (TargetArch V, IntelArch A)
static constexpr OffloadArch getUnused ()
static constexpr OffloadArch getUnknown ()
static constexpr OffloadArch getSPIRV ()
static constexpr OffloadArch getGeneric ()
static OffloadArch CudaDefault ()
 Default architectures used when the user does not specify one.
static OffloadArch HIPDefault ()

Detailed Description

A processor an offloading action can target.

This is a tagged handle pairing a TargetArch with the matching TargetParser GPU kind; it does not enumerate individual GPUs, so new targets are added in the TargetParser data alone.

Definition at line 32 of file OffloadArch.h.

Member Enumeration Documentation

◆ IntelArch

Enumerator
GRANITERAPIDS 
BMG_G21 

Definition at line 46 of file OffloadArch.h.

◆ TargetArch

Enumerator
Unused 
Unknown 
NVPTX 
AMDGPU 
SPIRV 
IntelCPU 
IntelGPU 
Generic 

Definition at line 34 of file OffloadArch.h.

Constructor & Destructor Documentation

◆ OffloadArch()

clang::OffloadArch::OffloadArch ( )
constexprdefault

Member Function Documentation

◆ amdgpuKind()

llvm::AMDGPU::GPUKind clang::OffloadArch::amdgpuKind ( ) const
inline

Definition at line 95 of file OffloadArch.h.

Referenced by clang::OffloadArchToString().

◆ CudaDefault()

OffloadArch clang::OffloadArch::CudaDefault ( )
static

Default architectures used when the user does not specify one.

Definition at line 18 of file OffloadArch.cpp.

References getNVPTX().

Referenced by clang::driver::Driver::getOffloadArchs(), and clang::driver::toolchains::NVPTXToolChain::TranslateArgs().

◆ getAMDGPU()

OffloadArch clang::OffloadArch::getAMDGPU ( llvm::AMDGPU::GPUKind K)
inlinestatic

Definition at line 64 of file OffloadArch.h.

References AMDGPU, and uint32_t.

Referenced by HIPDefault(), and clang::StringToOffloadArch().

◆ getGeneric()

constexpr OffloadArch clang::OffloadArch::getGeneric ( )
inlinestaticconstexpr

Definition at line 73 of file OffloadArch.h.

References Generic.

Referenced by clang::driver::Driver::getOffloadArchs(), and clang::StringToOffloadArch().

◆ getIntel()

constexpr OffloadArch clang::OffloadArch::getIntel ( TargetArch V,
IntelArch A )
inlinestaticconstexpr

Definition at line 67 of file OffloadArch.h.

References uint32_t.

Referenced by clang::StringToOffloadArch().

◆ getNVPTX()

OffloadArch clang::OffloadArch::getNVPTX ( llvm::NVPTX::GPUKind K)
inlinestatic

Definition at line 61 of file OffloadArch.h.

References NVPTX, and uint32_t.

Referenced by CudaDefault(), and clang::StringToOffloadArch().

◆ getSPIRV()

constexpr OffloadArch clang::OffloadArch::getSPIRV ( )
inlinestaticconstexpr

Definition at line 72 of file OffloadArch.h.

References SPIRV.

Referenced by clang::StringToOffloadArch().

◆ getUnknown()

constexpr OffloadArch clang::OffloadArch::getUnknown ( )
inlinestaticconstexpr

Definition at line 71 of file OffloadArch.h.

References Unknown.

Referenced by clang::StringToOffloadArch().

◆ getUnused()

constexpr OffloadArch clang::OffloadArch::getUnused ( )
inlinestaticconstexpr

◆ HIPDefault()

OffloadArch clang::OffloadArch::HIPDefault ( )
static

Definition at line 22 of file OffloadArch.cpp.

References getAMDGPU().

Referenced by clang::driver::Driver::getOffloadArchs().

◆ isAMDGPU()

bool clang::OffloadArch::isAMDGPU ( ) const
inline

Definition at line 82 of file OffloadArch.h.

References AMDGPU.

Referenced by clang::IsAMDOffloadArch().

◆ isGeneric()

bool clang::OffloadArch::isGeneric ( ) const
inline

Definition at line 87 of file OffloadArch.h.

References Generic.

◆ isIntel()

bool clang::OffloadArch::isIntel ( ) const
inline

Definition at line 86 of file OffloadArch.h.

References isIntelCPU(), and isIntelGPU().

Referenced by clang::IsIntelOffloadArch().

◆ isIntelCPU()

bool clang::OffloadArch::isIntelCPU ( ) const
inline

Definition at line 84 of file OffloadArch.h.

References IntelCPU.

Referenced by isIntel(), and clang::IsIntelCPUOffloadArch().

◆ isIntelGPU()

bool clang::OffloadArch::isIntelGPU ( ) const
inline

Definition at line 85 of file OffloadArch.h.

References IntelGPU.

Referenced by isIntel(), and clang::IsIntelGPUOffloadArch().

◆ isNVPTX()

bool clang::OffloadArch::isNVPTX ( ) const
inline

Definition at line 81 of file OffloadArch.h.

References NVPTX.

Referenced by clang::IsNVIDIAOffloadArch(), and clang::MaxVersionForOffloadArch().

◆ isSPIRV()

bool clang::OffloadArch::isSPIRV ( ) const
inline

Definition at line 83 of file OffloadArch.h.

References SPIRV.

Referenced by clang::IsAMDOffloadArch().

◆ isUnknown()

bool clang::OffloadArch::isUnknown ( ) const
inline

◆ isUnused()

bool clang::OffloadArch::isUnused ( ) const
inline

Definition at line 88 of file OffloadArch.h.

References Unused.

◆ nvptxKind()

llvm::NVPTX::GPUKind clang::OffloadArch::nvptxKind ( ) const
inline

◆ operator!=()

bool clang::OffloadArch::operator!= ( const OffloadArch & Other) const
inline

Definition at line 102 of file OffloadArch.h.

References clang::Other.

◆ operator<()

bool clang::OffloadArch::operator< ( const OffloadArch & Other) const
inline

Definition at line 104 of file OffloadArch.h.

References clang::Other.

◆ operator==()

bool clang::OffloadArch::operator== ( const OffloadArch & Other) const
inline

Definition at line 99 of file OffloadArch.h.

References clang::Other.

◆ targetArch()

TargetArch clang::OffloadArch::targetArch ( ) const
inline

The documentation for this class was generated from the following files: