MLIR
20.0.0git
|
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h"
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVAttributes.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVEnums.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
#include "mlir/Dialect/SPIRV/IR/SPIRVTypes.h"
#include "mlir/Dialect/SPIRV/IR/TargetAndABI.h"
#include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Matchers.h"
#include "mlir/Transforms/DialectConversion.h"
#include <optional>
Go to the source code of this file.
Classes | |
class | GPUAllReduceConversion |
Pattern to convert a gpu.all_reduce op into a SPIR-V group op. More... | |
class | GPUSubgroupReduceConversion |
Pattern to convert a gpu.subgroup_reduce op into a SPIR-V group op. More... | |
Functions | |
static spirv::FuncOp | lowerAsEntryFunction (gpu::GPUFuncOp funcOp, const TypeConverter &typeConverter, ConversionPatternRewriter &rewriter, spirv::EntryPointABIAttr entryPointInfo, ArrayRef< spirv::InterfaceVarABIAttr > argABIInfo) |
static LogicalResult | getDefaultABIAttrs (const spirv::TargetEnv &targetEnv, gpu::GPUFuncOp funcOp, SmallVectorImpl< spirv::InterfaceVarABIAttr > &argABI) |
Populates argABI with spirv.interface_var_abi attributes for lowering gpu.func to spirv.func if no arguments have the attributes set already. More... | |
template<typename UniformOp , typename NonUniformOp > | |
static Value | createGroupReduceOpImpl (OpBuilder &builder, Location loc, Value arg, bool isGroup, bool isUniform) |
static std::optional< Value > | createGroupReduceOp (OpBuilder &builder, Location loc, Value arg, gpu::AllReduceOperation opType, bool isGroup, bool isUniform) |
static std::string | makeVarName (spirv::ModuleOp moduleOp, llvm::Twine prefix) |
Variables | |
static constexpr const char | kSPIRVModule [] = "__spv__" |
|
static |
Definition at line 482 of file GPUToSPIRV.cpp.
References createGroupReduceOpImpl(), mlir::Value::getType(), and MINUI.
Referenced by GPUAllReduceConversion::matchAndRewrite(), and GPUSubgroupReduceConversion::matchAndRewrite().
|
static |
Definition at line 466 of file GPUToSPIRV.cpp.
References mlir::OpBuilder::create(), mlir::get(), mlir::Builder::getContext(), and mlir::Value::getType().
Referenced by createGroupReduceOp().
|
static |
Populates argABI
with spirv.interface_var_abi attributes for lowering gpu.func to spirv.func if no arguments have the attributes set already.
Returns failure if any argument has the ABI attribute set already.
Definition at line 284 of file GPUToSPIRV.cpp.
References mlir::spirv::getInterfaceVarABIAttr(), mlir::spirv::getInterfaceVarABIAttrName(), and mlir::spirv::needsInterfaceVarABIAttrs().
|
static |
Definition at line 223 of file GPUToSPIRV.cpp.
References mlir::TypeConverter::SignatureConversion::addInputs(), mlir::ConversionPatternRewriter::convertRegionTypes(), mlir::TypeConverter::convertType(), mlir::OpBuilder::create(), mlir::detail::enumerate(), mlir::ConversionPatternRewriter::eraseOp(), mlir::TypeConverter::SignatureConversion::getConvertedTypes(), mlir::spirv::getEntryPointABIAttrName(), mlir::Builder::getFunctionType(), mlir::spirv::getInterfaceVarABIAttrName(), mlir::SymbolTable::getSymbolAttrName(), mlir::RewriterBase::inlineRegionBefore(), and mlir::Operation::setAttr().
|
static |
Definition at line 614 of file GPUToSPIRV.cpp.
|
staticconstexpr |
Definition at line 29 of file GPUToSPIRV.cpp.