MLIR 22.0.0git
GPUToLLVMConversion.cpp File Reference

Go to the source code of this file.

Classes

class  mlir::impl::GpuToLLVMConversionPassBase< DerivedT >

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::impl
 Attribute collections provide a dictionary-like interface.

Macros

#define DEBUG_TYPE   "gpu-to-llvm"
#define GEN_PASS_DEF_GPUTOLLVMCONVERSIONPASS
#define DECLARE_CONVERT_OP_TO_GPU_RUNTIME_CALL_PATTERN(op_name)
 Generic rewriting rule for operation on sparse matrices.

Functions

std::unique_ptr<::mlir::Passmlir::impl::createGpuToLLVMConversionPass ()
std::unique_ptr<::mlir::Passmlir::impl::createGpuToLLVMConversionPass (GpuToLLVMConversionPassOptions options)
std::unique_ptr<::mlir::Passmlir::createGpuToLLVMConversionPass ()
std::unique_ptr<::mlir::Passmlir::createGpuToLLVMConversionPass (GpuToLLVMConversionPassOptions options)
static int32_t getCuSparseIndexTypeFrom (Type type)
static int32_t getCuSparseLtDataTypeFrom (Type type)
static int32_t getCuSparseDataTypeFrom (Type type)
static gpu::Prune2To4SpMatFlag get2To4PruneFlag (Value spMat)
static bool is2To4Sparsity (Value spMat)
static bool isSpMMCusparseLtOp (Value op)
static LogicalResult areAllLLVMTypes (Operation *op, ValueRange operands, ConversionPatternRewriter &rewriter)
static LogicalResult isAsyncWithOneDependency (ConversionPatternRewriter &rewriter, gpu::AsyncOpInterface op)
static bool isGpuAsyncTokenType (Value value)
static bool isDefinedByCallTo (Value value, StringRef functionName)
static Value bitAndAddrspaceCast (Location loc, ConversionPatternRewriter &rewriter, LLVM::LLVMPointerType destinationType, Value sourcePtr, const LLVMTypeConverter &typeConverter)
template<typename T>
static Value genConstInt32From (OpBuilder &builder, Location loc, T tValue)
template<typename T>
static Value genConstFloat32From (OpBuilder &builder, Location loc, T tValue)
template<typename T>
static void addOpaquePointerConversion (LLVMTypeConverter &converter)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "gpu-to-llvm"

Definition at line 42 of file GPUToLLVMConversion.cpp.

◆ DECLARE_CONVERT_OP_TO_GPU_RUNTIME_CALL_PATTERN

#define DECLARE_CONVERT_OP_TO_GPU_RUNTIME_CALL_PATTERN ( op_name)
Value:
class Convert##op_name##ToGpuRuntimeCallPattern \
: public ConvertOpToGpuRuntimeCallPattern<gpu::op_name> { \
public: \
Convert##op_name##ToGpuRuntimeCallPattern( \
const LLVMTypeConverter &typeConverter) \
: ConvertOpToGpuRuntimeCallPattern<gpu::op_name>(typeConverter) {} \
\
private: \
LogicalResult \
matchAndRewrite(gpu::op_name op, OpAdaptor adaptor, \
ConversionPatternRewriter &rewriter) const override; \
};
Conversion from types to the LLVM IR dialect.

Generic rewriting rule for operation on sparse matrices.

Currently supports CUDA (by means of cuSparse and cuSparseLt).

Definition at line 488 of file GPUToLLVMConversion.cpp.

◆ GEN_PASS_DEF_GPUTOLLVMCONVERSIONPASS

#define GEN_PASS_DEF_GPUTOLLVMCONVERSIONPASS

Definition at line 45 of file GPUToLLVMConversion.cpp.

Function Documentation

◆ addOpaquePointerConversion()

template<typename T>
void addOpaquePointerConversion ( LLVMTypeConverter & converter)
static

◆ areAllLLVMTypes()

LogicalResult areAllLLVMTypes ( Operation * op,
ValueRange operands,
ConversionPatternRewriter & rewriter )
static

◆ bitAndAddrspaceCast()

Value bitAndAddrspaceCast ( Location loc,
ConversionPatternRewriter & rewriter,
LLVM::LLVMPointerType destinationType,
Value sourcePtr,
const LLVMTypeConverter & typeConverter )
static

Definition at line 1047 of file GPUToLLVMConversion.cpp.

References mlir::Value::getType().

◆ genConstFloat32From()

template<typename T>
Value genConstFloat32From ( OpBuilder & builder,
Location loc,
T tValue )
static

◆ genConstInt32From()

template<typename T>
Value genConstInt32From ( OpBuilder & builder,
Location loc,
T tValue )
static

Definition at line 1154 of file GPUToLLVMConversion.cpp.

References mlir::Builder::getIntegerType().

◆ get2To4PruneFlag()

gpu::Prune2To4SpMatFlag get2To4PruneFlag ( Value spMat)
static

Definition at line 647 of file GPUToLLVMConversion.cpp.

References mlir::Value::getDefiningOp().

◆ getCuSparseDataTypeFrom()

int32_t getCuSparseDataTypeFrom ( Type type)
static

◆ getCuSparseIndexTypeFrom()

int32_t getCuSparseIndexTypeFrom ( Type type)
static

Definition at line 592 of file GPUToLLVMConversion.cpp.

References mlir::Type::isInteger().

◆ getCuSparseLtDataTypeFrom()

int32_t getCuSparseLtDataTypeFrom ( Type type)
static

Definition at line 600 of file GPUToLLVMConversion.cpp.

References mlir::Type::isF16(), and mlir::Type::isInteger().

◆ is2To4Sparsity()

bool is2To4Sparsity ( Value spMat)
static

Definition at line 658 of file GPUToLLVMConversion.cpp.

References mlir::Value::getDefiningOp(), and mlir::Operation::print().

Referenced by isSpMMCusparseLtOp().

◆ isAsyncWithOneDependency()

LogicalResult isAsyncWithOneDependency ( ConversionPatternRewriter & rewriter,
gpu::AsyncOpInterface op )
static

Definition at line 700 of file GPUToLLVMConversion.cpp.

References success().

◆ isDefinedByCallTo()

bool isDefinedByCallTo ( Value value,
StringRef functionName )
static

◆ isGpuAsyncTokenType()

bool isGpuAsyncTokenType ( Value value)
static

Definition at line 833 of file GPUToLLVMConversion.cpp.

References mlir::Value::getType().

◆ isSpMMCusparseLtOp()

bool isSpMMCusparseLtOp ( Value op)
static

Definition at line 676 of file GPUToLLVMConversion.cpp.

References mlir::Value::getUsers(), and is2To4Sparsity().