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"
58 llvm_unreachable(
"Unknown InstructionKind");
61 static std::optional<InstructionKind>
63 if (str.equals_insensitive(
"dpas"))
140 const std::map<InstructionKind, std::shared_ptr<Instruction>>
151 const std::map<RegisterFileType, RegisterFileInfo> &
160 const std::map<InstructionKind, std::shared_ptr<Instruction>> &
172 return instructionNames;
185 std::map<InstructionKind, std::shared_ptr<Instruction>>
243 std::pair<uint32_t, uint32_t> BShape,
244 std::pair<uint32_t, uint32_t> CShape,
245 std::pair<uint32_t, uint32_t> DShape,
Type AType,
249 virtual bool validate(std::pair<uint32_t, uint32_t> AShape,
250 std::pair<uint32_t, uint32_t> BShape,
251 std::pair<uint32_t, uint32_t> CShape,
252 std::pair<uint32_t, uint32_t> DShape,
Type AType,
union mlir::linalg::@1247::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...
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)
static std::optional< InstructionKind > parseInstructionKind(llvm::StringRef str)
static llvm::StringRef toString(InstructionKind instKind)
virtual ~Instruction()=default
InstructionKind getInstructionKind()
InstructionScope getScope()
virtual llvm::SmallVector< uint32_t, 8 > getSupportedM(Type type)=0
virtual ~MMAInstructionInterface()=default
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< Type, 8 > getSupportedTypes(MLIRContext &context, MMAOpndKind matrixType)=0
virtual llvm::SmallVector< uint32_t, 8 > getSupportedN(Type type)=0
virtual llvm::SmallVector< uint32_t, 8 > getSupportedK(Type type)=0
virtual llvm::SmallVector< std::pair< uint32_t, uint32_t >, 16 > getSupportedShapes(Type dataType, MMAOpndKind matrixType)=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)
const std::map< RegisterFileType, RegisterFileInfo > & getRegisterFileInfo() const
const llvm::SmallVector< CacheInfo, 4 > & getCacheInfo() const
const std::string & getDescription() const
const std::map< InstructionKind, std::shared_ptr< Instruction > > & getInstructions() const
const std::string & getName() const
llvm::SmallVector< StringRef, 8 > getSupportedInstructionNames() const
bool checkSupportedInstruction(InstructionKind instr) const
std::map< InstructionKind, std::shared_ptr< Instruction > > instructions
llvm::SmallVector< CacheInfo, 4 > cacheInfo
uArch(const std::string &name, const std::string &description, const std::map< RegisterFileType, RegisterFileInfo > ®isterFileInfo={}, const llvm::SmallVector< CacheInfo, 4 > &cacheInfo={}, const std::map< InstructionKind, std::shared_ptr< Instruction >> &instructions={})
std::map< RegisterFileType, RegisterFileInfo > registerFileInfo