LLVM 24.0.0git
IntelGPUTargetParser.cpp File Reference
#include "llvm/TargetParser/IntelGPUTargetParser.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include "llvm/TargetParser/IntelGPUTargetParser.def"

Go to the source code of this file.

Macros

#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS)
#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS)
#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS)
#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS)
#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS)
#define INTEL_GPU_ALIAS(NAME, KIND)
#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS)
#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS)
#define IGCA_TARGET_NAMES(TARGET)
#define INTEL_GPU(NAME, KIND, MAJOR, MINOR, IGCA_TARGET, IGCA_FEATURE_SETS)
#define INTEL_GPU_COMPAT(NAME, KIND, IGCA_TARGET, IGCA_FEATURE_SETS)

Functions

static constexpr uint32_t packDevice (uint32_t Major, uint32_t Minor)
static bool deviceCanRunIGCAFeatureSet (IGCAFeatureSet DeviceFeatureSet, IGCAFeatureSet RequestedFeatureSet)

Variables

static constexpr uint32_t GPUIPMajorShift = 22
static constexpr uint32_t GPUIPMinorShift = 14
static constexpr uint32_t GPUIPMajorMask = 0x3ff
static constexpr uint32_t GPUIPMinorMask = 0xff
static constexpr uint32_t GPUIPRevisionMask = 0x3f
static constexpr uint32_t GPUIPDeviceMask = ~0u << GPUIPMinorShift

Macro Definition Documentation

◆ IGCA_TARGET_NAMES

#define IGCA_TARGET_NAMES ( TARGET)
Value:
{"igca_" #TARGET, TARGET, IGCAFeatureSet::Core}, \
{"igca_" #TARGET "c", TARGET, IGCAFeatureSet::Compute}, \
{"igca_" #TARGET "ca", TARGET, IGCAFeatureSet::ComputeExact}, \
{"igca_" #TARGET "r", TARGET, IGCAFeatureSet::Render}, \
{"igca_" #TARGET "ra", TARGET, IGCAFeatureSet::RenderExact},

Definition at line 133 of file IntelGPUTargetParser.cpp.

◆ INTEL_GPU [1/5]

#define INTEL_GPU ( NAME,
KIND,
MAJOR,
MINOR,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
if (Device == packDevice(MAJOR, MINOR)) \
return NAME;
static constexpr uint32_t packDevice(uint32_t Major, uint32_t Minor)

◆ INTEL_GPU [2/5]

#define INTEL_GPU ( NAME,
KIND,
MAJOR,
MINOR,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
case GK_##KIND: \
return NAME;
#define KIND(ENUM, FIELD)
Definition LVSupport.h:116

◆ INTEL_GPU [3/5]

#define INTEL_GPU ( NAME,
KIND,
MAJOR,
MINOR,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
.Case(NAME, GK_##KIND).Case("xe_" #MAJOR "." #MINOR, GK_##KIND)

◆ INTEL_GPU [4/5]

#define INTEL_GPU ( NAME,
KIND,
MAJOR,
MINOR,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
{IGCA_TARGET, IGCAFeatureSet::IGCA_FEATURE_SETS},

◆ INTEL_GPU [5/5]

#define INTEL_GPU ( NAME,
KIND,
MAJOR,
MINOR,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
IGCA_TARGET_NAMES(IGCA_TARGET)
#define IGCA_TARGET_NAMES(TARGET)

◆ INTEL_GPU_ALIAS

#define INTEL_GPU_ALIAS ( NAME,
KIND )
Value:
.Case(NAME, GK_##KIND)

◆ INTEL_GPU_COMPAT [1/4]

#define INTEL_GPU_COMPAT ( NAME,
KIND,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
case GK_##KIND: \
return NAME;

◆ INTEL_GPU_COMPAT [2/4]

#define INTEL_GPU_COMPAT ( NAME,
KIND,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
.Case(NAME, GK_##KIND)

◆ INTEL_GPU_COMPAT [3/4]

#define INTEL_GPU_COMPAT ( NAME,
KIND,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
{IGCA_TARGET, IGCAFeatureSet::IGCA_FEATURE_SETS},

◆ INTEL_GPU_COMPAT [4/4]

#define INTEL_GPU_COMPAT ( NAME,
KIND,
IGCA_TARGET,
IGCA_FEATURE_SETS )
Value:
IGCA_TARGET_NAMES(IGCA_TARGET)

Function Documentation

◆ deviceCanRunIGCAFeatureSet()

bool deviceCanRunIGCAFeatureSet ( IGCAFeatureSet DeviceFeatureSet,
IGCAFeatureSet RequestedFeatureSet )
static
Returns
true if a device with the IGCA feature set DeviceFeatureSet can run code built for the IGCA feature set RequestedFeatureSet at the device's own numeric IGCA target. For example, xe-pvc (igca_20ca, ComputeExact) can run code built for igca_20ca, igca_20c and igca_20, but not igca_20r.

Definition at line 154 of file IntelGPUTargetParser.cpp.

◆ packDevice()

constexpr uint32_t packDevice ( uint32_t Major,
uint32_t Minor )
staticconstexpr

Variable Documentation

◆ GPUIPDeviceMask

uint32_t GPUIPDeviceMask = ~0u << GPUIPMinorShift
staticconstexpr

Definition at line 42 of file IntelGPUTargetParser.cpp.

Referenced by llvm::IntelGPU::getArchName().

◆ GPUIPMajorMask

uint32_t GPUIPMajorMask = 0x3ff
staticconstexpr

Definition at line 35 of file IntelGPUTargetParser.cpp.

Referenced by packDevice().

◆ GPUIPMajorShift

uint32_t GPUIPMajorShift = 22
staticconstexpr

Definition at line 33 of file IntelGPUTargetParser.cpp.

Referenced by llvm::IntelGPU::getNumericArchName(), and packDevice().

◆ GPUIPMinorMask

uint32_t GPUIPMinorMask = 0xff
staticconstexpr

Definition at line 36 of file IntelGPUTargetParser.cpp.

Referenced by llvm::IntelGPU::getNumericArchName(), and packDevice().

◆ GPUIPMinorShift

uint32_t GPUIPMinorShift = 14
staticconstexpr

Definition at line 34 of file IntelGPUTargetParser.cpp.

Referenced by llvm::IntelGPU::getNumericArchName(), and packDevice().

◆ GPUIPRevisionMask

uint32_t GPUIPRevisionMask = 0x3f
staticconstexpr

Definition at line 37 of file IntelGPUTargetParser.cpp.

Referenced by llvm::IntelGPU::getNumericArchName().