14#ifndef MLIR_DIALECT_GPU_IR_GPUBASE_H
15#define MLIR_DIALECT_GPU_IR_GPUBASE_H
40 static constexpr StringLiteral
name =
"gpu.async_token";
48 static constexpr StringLiteral
name =
"gpu.named_barrier";
60 using KeyTy = std::tuple<ArrayRef<int64_t>,
Type, StringRef>;
131 :
public Type::TypeBase<MMAMatrixType, Type, MMAMatrixStorageType,
132 MemRefElementTypeInterface::Trait> {
136 static constexpr StringLiteral
name =
"gpu.mma_matrix";
177 :
public Type::TypeBase<SparseDnTensorHandleType, Type, TypeStorage> {
183 static constexpr StringLiteral
name =
"gpu.sparse.dntensor_handle";
187 :
public Type::TypeBase<SparseSpMatHandleType, Type, TypeStorage> {
192 static constexpr StringLiteral
name =
"gpu.sparse.spmat_handle";
196 :
public Type::TypeBase<SparseSpGEMMOpHandleType, Type, TypeStorage> {
202 static constexpr StringLiteral
name =
"gpu.sparse.spgemmop_handle";
206#define GET_ATTRDEF_CLASSES
207#include "mlir/Dialect/GPU/IR/GPUOpsAttributes.h.inc"
This class represents a diagnostic that is inflight and set to be reported.
MLIRContext is the top-level object for a collection of MLIR operations.
ArrayRef< T > copyInto(ArrayRef< T > elements)
Copy the specified array of elements into memory managed by our bump pointer allocator.
T * allocate()
Allocate an instance of the provided type.
TypeStorage()
This constructor is used by derived classes as part of the TypeUniquer.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
detail::StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... > TypeBase
Utility class for implementing types.
StorageUserBase< ConcreteType, BaseType, StorageType, detail::TypeUniquer, Traits... > Base
static constexpr StringLiteral name
MMAMatrix represents a matrix held by a subgroup for matrix-matrix multiply accumulate operations.
ArrayRef< int64_t > getShape() const
Get shape of the matrix.
static MMAMatrixType get(ArrayRef< int64_t > shape, Type elementType, StringRef operand)
Get MMAMatrixType and verify construction Invariants.
Type getElementType() const
Get elementType of a single element.
static bool isValidElementType(Type elementType)
Check if a type is valid a MMAMatrixType elementType.
static LogicalResult verifyInvariants(function_ref< InFlightDiagnostic()> emitError, ArrayRef< int64_t > shape, Type elementType, StringRef operand)
Verify that shape and elementType are actually allowed for the MMAMatrixType.
StringRef getOperand() const
The general form of operation this type supports is given by the equation C += A*B.
static MMAMatrixType getChecked(function_ref< InFlightDiagnostic()> emitError, ArrayRef< int64_t > shape, Type elementType, StringRef operand)
Get MMAMatrixType at a particular location and verify construction Invariants.
static constexpr StringLiteral name
unsigned getNumDims() const
Get number of dims.
static constexpr StringLiteral name
Type::TypeBase< SparseDnTensorHandleType, Type, TypeStorage >::Base Base
static constexpr StringLiteral name
static constexpr StringLiteral name
Type::TypeBase< SparseSpGEMMOpHandleType, Type, TypeStorage >::Base Base
Type::TypeBase< SparseSpMatHandleType, Type, TypeStorage >::Base Base
static constexpr StringLiteral name
void registerAttributeStorage(MLIRContext *context)
Register storage whose definitions are private to MLIRGPUBase.
StorageUniquer::StorageAllocator TypeStorageAllocator
This is a utility allocator used to allocate memory for instances of derived Types.
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
llvm::function_ref< Fn > function_ref
StringRef operand
MMA operand that this MMAMatrix holds.
static MMAMatrixStorageType * construct(TypeStorageAllocator &allocator, const KeyTy &key)
Construction.
unsigned numDims
Number of dimensions in the MMA matrix.
ArrayRef< int64_t > getShape() const
const int64_t * dimShapes
Reference to the shape of the MMA matrix.
StringRef getOperand() const
MMAMatrixStorageType(unsigned numDims, const int64_t *dimShapes, Type elementType, StringRef operand)
Type elementType
Element type of elements held in the MMA matrix.
std::tuple< ArrayRef< int64_t >, Type, StringRef > KeyTy
The hash key for uniquing.
bool operator==(const KeyTy &key) const