14 #ifndef MLIR_DIALECT_GPU_IR_GPUDIALECT_H
15 #define MLIR_DIALECT_GPU_IR_GPUDIALECT_H
32 #include "llvm/ADT/STLExtras.h"
51 static constexpr StringLiteral
name =
"gpu.async_token";
63 using KeyTy = std::tuple<ArrayRef<int64_t>,
Type, StringRef>;
131 :
public Type::TypeBase<MMAMatrixType, Type, MMAMatrixStorageType> {
135 static constexpr StringLiteral
name =
"gpu.mma_matrix";
179 :
public Type::TypeBase<SparseDnTensorHandleType, Type, TypeStorage> {
185 static constexpr StringLiteral
name =
"gpu.sparse.dntensor_handle";
189 :
public Type::TypeBase<SparseSpMatHandleType, Type, TypeStorage> {
195 static constexpr StringLiteral
name =
"gpu.sparse.spmat_handle";
199 :
public Type::TypeBase<SparseSpGEMMOpHandleType, Type, TypeStorage> {
205 static constexpr StringLiteral
name =
"gpu.sparse.spgemmop_handle";
211 #include "mlir/Dialect/GPU/IR/GPUOpsEnums.h.inc"
213 #include "mlir/Dialect/GPU/IR/GPUOpsDialect.h.inc"
215 #include "mlir/Dialect/GPU/IR/GPUOpInterfaces.h.inc"
219 #define GET_ATTRDEF_CLASSES
220 #include "mlir/Dialect/GPU/IR/GPUOpsAttributes.h.inc"
222 #define GET_OP_CLASSES
223 #include "mlir/Dialect/GPU/IR/GPUOps.h.inc"
This class represents a diagnostic that is inflight and set to be reported.
Operation is the basic unit of execution within MLIR.
This is a utility allocator used to allocate memory for instances of derived types.
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.
Base storage class appearing in a Type.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Utility class for implementing users of storage classes uniqued by a StorageUniquer.
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
typename Type::TypeBase< SparseDnTensorHandleType, Type, TypeStorage >::Base Base
static constexpr StringLiteral name
typename Type::TypeBase< SparseSpGEMMOpHandleType, Type, TypeStorage >::Base Base
static constexpr StringLiteral name
typename Type::TypeBase< SparseSpMatHandleType, Type, TypeStorage >::Base Base
void addAsyncDependency(Operation *op, Value token)
Include the generated interface declarations.
InFlightDiagnostic emitError(Location loc)
Utility method to emit an error message using this location.
Utility class for the GPU dialect to represent triples of Values accessible through ....
MMAMatrixType storage and uniquing.
StringRef operand
MMA operand that this MMAMatrix holds.
ArrayRef< int64_t > getShape() const
static MMAMatrixStorageType * construct(TypeStorageAllocator &allocator, const KeyTy &key)
Construction.
unsigned numDims
Number of dimensions in the MMA matrix.
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