14 #ifndef MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H
15 #define MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H
22 #include <shared_mutex>
26 #include "llvm/ADT/SmallVector.h"
69 llvm_unreachable(
"Unknown InstructionKind");
72 static std::optional<InstructionKind>
74 if (str.equals_insensitive(
"dpas"))
149 this->instructionRegistry[instr->getInstructionKind()] = instr;
160 "Instruction not found in registry");
171 llvm::SmallDenseMap<InstructionKind, const Instruction *, 32>
229 std::pair<uint32_t, uint32_t> BShape,
230 std::pair<uint32_t, uint32_t> CShape,
231 std::pair<uint32_t, uint32_t> DShape,
Type AType,
235 virtual bool validate(std::pair<uint32_t, uint32_t> AShape,
236 std::pair<uint32_t, uint32_t> BShape,
237 std::pair<uint32_t, uint32_t> CShape,
238 std::pair<uint32_t, uint32_t> DShape,
Type AType,
union mlir::linalg::@1257::ArityGroupAndKind::Kind kind
MLIRContext is the top-level object for a collection of MLIR operations.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
@ Subgroup2DBlockPrefetch
@ SubgroupMatrixMultiplyAcc
constexpr unsigned generalPackedFormatBitSize
Include the generated interface declarations.
uint32_t getLineSize() const
CacheHierarchyLevel hierarchy_level
virtual ~CacheInfo()=default
CacheInfo(uint32_t size, uint32_t line_size, CacheHierarchyLevel hierarchy_level)
CacheHierarchyLevel getHierarchyLevel() const
Instruction(InstructionKind kind, InstructionScope scope)
const InstructionScope scope
static std::optional< InstructionKind > parseInstructionKind(llvm::StringRef str)
InstructionScope getScope() const
static llvm::StringRef toString(InstructionKind instKind)
InstructionKind getInstructionKind() const
const InstructionKind instKind
virtual ~MMAInstructionInterface()=default
virtual llvm::SmallVector< uint32_t, 8 > getSupportedK(Type type) const =0
virtual bool checkSupportedShapesAndTypes(std::pair< uint32_t, uint32_t > AShape, std::pair< uint32_t, uint32_t > BShape, std::pair< uint32_t, uint32_t > CShape, std::pair< uint32_t, uint32_t > DShape, Type AType, Type BType, Type CType, Type DType)=0
virtual bool checkSupportedTypes(Type AType, Type BType, Type CType, Type DType)=0
virtual bool validate(std::pair< uint32_t, uint32_t > AShape, std::pair< uint32_t, uint32_t > BShape, std::pair< uint32_t, uint32_t > CShape, std::pair< uint32_t, uint32_t > DShape, Type AType, Type BType, Type CType, Type DType)=0
virtual llvm::SmallVector< uint32_t, 8 > getSupportedM(Type type) const =0
virtual llvm::SmallVector< Type, 8 > getSupportedTypes(MLIRContext &context, MMAOpndKind matrixType)=0
virtual llvm::SmallVector< std::pair< uint32_t, uint32_t >, 16 > getSupportedShapes(Type dataType, MMAOpndKind matrixType)=0
virtual llvm::SmallVector< uint32_t, 8 > getSupportedN(Type type) const =0
RegisterFileInfo()=default
const llvm::SmallVector< uint32_t, 4 > & getNumRegsPerThreadPerMode() const
llvm::SmallVector< RegisterFileMode, 4 > mode
RegisterFileInfo(uint32_t size, const llvm::SmallVector< RegisterFileMode, 4 > &mode, const llvm::SmallVector< uint32_t, 4 > &numRegs)
llvm::SmallVector< uint32_t, 4 > numRegsPerThreadPerMode
const llvm::SmallVector< RegisterFileMode, 4 > & getModes() const
uint32_t getAlignment() const
SharedMemory(uint32_t size, uint32_t alignment)
uint32_t num_vector_units
uint32_t num_matrix_units
SharedMemory shared_memory
XeCoreInfo(uint32_t num_threads, const SharedMemory &shared_memory, uint32_t num_vector_units, uint32_t num_matrix_units)
llvm::SmallDenseMap< InstructionKind, const Instruction *, 32 > instructionRegistry
const Instruction * getInstruction(InstructionKind instKind) const
StringRef getDescription() const
virtual unsigned getGeneralPackedFormatBitSize() const =0
bool isSupportedInstruction(InstructionKind instr) const
virtual int getSubgroupSize() const =0
uArch(StringRef name, StringRef description, llvm::ArrayRef< const Instruction * > instructionRegistry)
StringRef getName() const