MLIR: lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
Functions
static std::string descriptorSetName ()
Returns the string name of the DescriptorSet decoration. More...
static std::string bindingName ()
Returns the string name of the Binding decoration. More...
static unsigned calculateGlobalIndex (spirv::GlobalVariableOp op)
Calculates the index of the kernel's operand that is represented by the given global variable with the bind attribute. More...
static void copy (Location loc, Value dst, Value src, Value size, OpBuilder &builder)
Copies the given number of bytes from src to dst pointers. More...
static std::string createGlobalVariableWithBindName (spirv::GlobalVariableOp op, StringRef kernelModuleName)
Encodes the binding and descriptor set numbers into a new symbolic name. More...
static bool hasDescriptorSetAndBinding (spirv::GlobalVariableOp op)
Returns true if the given global variable has both a descriptor set number and a binding number. More...
static LogicalResult getKernelGlobalVariables (spirv::ModuleOp module, DenseMap< uint32_t, spirv::GlobalVariableOp > &globalVariableMap)
Fills globalVariableMap with SPIR-V global variables that represent kernel arguments from the given SPIR-V module. More...
static LogicalResult encodeKernelName (spirv::ModuleOp module)
Encodes the SPIR-V module's symbolic name into the name of the entry point function. More...
Variables
static constexpr const char kSPIRVModule [] = "__spv__"

GEN_PASS_DEF_LOWERHOSTCODETOLLVMPASS

#define GEN_PASS_DEF_LOWERHOSTCODETOLLVMPASS

bindingName()

static std::string bindingName ( ) static

calculateGlobalIndex()

static unsigned calculateGlobalIndex ( spirv::GlobalVariableOp op) static

Calculates the index of the kernel's operand that is represented by the given global variable with the bind attribute.

We assume that the index of each kernel's operand is mapped to (descriptorSet, binding) by the map: i -> (0, i) which is implemented under LowerABIAttributesPass.

Definition at line 65 of file ConvertLaunchFuncToLLVMCalls.cpp.

References bindingName().

Referenced by getKernelGlobalVariables().

copy()

Copies the given number of bytes from src to dst pointers.

Definition at line 71 of file ConvertLaunchFuncToLLVMCalls.cpp.

References mlir::OpBuilder::create().

Referenced by mlir::bufferization::castOrReallocMemRefValue(), mlir::presburger::IntegerRelation::computeReprWithOnlyDivLocals(), mlir::computeShapeRatio(), mlir::detail::DenseIntOrFPElementsAttrStorage::construct(), mlir::detail::DenseStringElementsAttrStorage::construct(), mlir::presburger::IntegerRelation::containsPointNoLocal(), convertDenseArrayFromAttr(), copyStringWithNull(), createNewAliasScopesFromNoAliasParameter(), doubleBuffer(), mlir::sparse_tensor::LoopEmitter::enterCoIterationOverTensorsAtLvls(), mlir::sparse_tensor::LoopEmitter::enterCurrentCoIterationCase(), mlir::sparse_tensor::LoopEmitter::exitCurrentLoop(), foldDenseElementsAttrDestInsertOp(), foldDenseElementsAttrSrcExtractOp(), foldExtractStridedSliceNonSplatConstant(), mlir::mesh::MeshSharding::get(), mlir::presburger::MultiAffineFunction::getAsRelation(), mlir::tosa::hasUniqueConstantScatterIndices(), isMaterializing(), mlir::detail::makeStridedMemRefDescriptor(), mlir::presburger::MultiAffineFunction::mergeDivs(), mlirMemRefTypeGetStridesAndOffset(), mlir::detail::TileOffsetRangeIterator< ElementType >::operator++(), replaceByPackingResult(), mlir::sparse_tensor::SparseIterator::seek(), and mlir::presburger::IntegerRelation::unionBoundingBox().

createGlobalVariableWithBindName()

static std::string createGlobalVariableWithBindName ( spirv::GlobalVariableOp op, StringRef kernelModuleName ) static

Encodes the binding and descriptor set numbers into a new symbolic name.

The name is specified by {kernel_module_name}_{variable_name}_descriptor_set{ds}_binding{b} to avoid symbolic conflicts, where 'ds' and 'b' are descriptor set and binding numbers.

Definition at line 82 of file ConvertLaunchFuncToLLVMCalls.cpp.

References bindingName(), and descriptorSetName().

descriptorSetName()

static std::string descriptorSetName ( ) static

encodeKernelName()

static LogicalResult encodeKernelName ( spirv::ModuleOp module) static

getKernelGlobalVariables()

static LogicalResult getKernelGlobalVariables ( spirv::ModuleOp module, DenseMap< uint32_t, spirv::GlobalVariableOp > & globalVariableMap ) static

hasDescriptorSetAndBinding()

static bool hasDescriptorSetAndBinding ( spirv::GlobalVariableOp op) static

kSPIRVModule

constexpr const char kSPIRVModule[] = "__spv__" staticconstexpr