MLIR 24.0.0git
uArchBase.h
Go to the documentation of this file.
1//===- uArch.h --------------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// \file
10// Base uArch definition for different architectures, plus the SPIRV / Khronos
11// OpenCL extension instruction defaults shared across Intel Xe uArchs.
12//
13//===----------------------------------------------------------------------===//
14#ifndef MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H
15#define MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H
16
17#include <cassert>
18#include <optional>
19#include <tuple>
20#include <utility>
21
24#include "mlir/IR/Types.h"
25#include "llvm/ADT/DenseMap.h"
26#include "llvm/ADT/STLExtras.h"
27#include "llvm/ADT/SmallVector.h"
28#include "llvm/ADT/StringRef.h"
29#include "llvm/Support/Casting.h"
30#include "llvm/Support/DebugLog.h"
31#include "llvm/Support/ErrorHandling.h"
32
33namespace mlir {
34namespace xegpu {
35namespace uArch {
36
37// An enum class to represent the scope of an instruction
39enum class InstructionKind {
40 SubgroupMatrixMultiplyAcc, // Dot Product Accumulate Systolic (DPAS) is a
41 // matrix multiply-add operation
42 SubgroupScaledMatrixMultiplyAcc, // Scaled Matrix Multiply Accumulate is a
43 // DPAS with scaling factor applied to
44 // operand A or B before multiplication
45 Subgroup2DBlockStore, // Subgroup-level 2D block write instruction
46 Subgroup2DBlockLoad, // Subgroup-level 2D block load instruction
47 Subgroup2DBlockPrefetch, // Subgroup-level 2D block prefetch instruction
48 StoreScatter, // Lane-level store (scalar, vector)
49 LoadGather, // Lane-level load (scalar, vector)
50};
51
52// A struct to represent basic information about an instruction.
53// The primary purpose of the Instruction struct is to provide a generic way to
54// represent information about an instruction and to use this information to
55// generate the uArch. Specifc instruction in a uArch can inherit from this
56// struct and add more fields as needed.
60
61 ~Instruction() = default;
62 // Get methods
64 InstructionScope getScope() const { return scope; }
65 static llvm::StringRef toString(InstructionKind instKind) {
66 switch (instKind) {
68 return "dpas";
70 return "dpas_mx";
72 return "store_nd";
74 return "load_nd";
76 return "prefetch_nd";
78 return "store";
80 return "load";
81 }
82 llvm_unreachable("Unknown InstructionKind");
83 }
84
85protected:
86 const InstructionKind instKind; // Specific InstructionKind (e.g., DPAS)
87 const InstructionScope scope; // scope of the instruction (e.g., lane,
88 // subgroup, workgroup, cluster)
89};
90
91// Restrictions on the 2D memory region accessed by the subgroup 2D block
92// load / store / prefetch instructions. These constrain the memory operand
93// rather than the block shape. All three instructions of a given architecture
94// share them, so they are a property of the uArch rather than of an individual
95// instruction.
96//
97// Unlike the supported block shapes, none of these limits are common across
98// architectures, so only the layout is defined here; the values are supplied by
99// the concrete uArch, see IntelGpuXe2.h and IntelGpuXe3p.h. All quantities are
100// in bytes.
102 // Required alignment of the base address of the 2D region.
104 // Minimum size of the base width, i.e. the number of bytes in one row of the
105 // 2D region.
107 // Required alignment of the base width.
109 // Minimum size of the base pitch, i.e. the number of bytes between the start
110 // of two consecutive rows of the 2D region.
112 // Required alignment of the base pitch. The pitch must additionally be no
113 // smaller than the base width.
115};
116
117struct uArch {
118 enum class Kind {
119 // Xe2 family
124 // Xe3p family
128 };
129
130 // Constructor
132 : kind(kind) {
133 for (const Instruction *instr : instructionRegistry)
134 this->instructionRegistry[instr->getInstructionKind()] = instr;
135 }
136 virtual ~uArch() = default;
137 Kind getKind() const { return kind; }
138
139 virtual int getSubgroupSize() const = 0;
140 virtual unsigned getGeneralPackedFormatBitSize() const = 0;
141 // Restrictions on the base address / width / pitch of the 2D memory region
142 // accessed by the subgroup 2D block instructions.
143 virtual const BlockIOMemoryRestrictions &
145
147 auto it = instructionRegistry.find(instKind);
148 assert(it != instructionRegistry.end() &&
149 "Instruction not found in registry");
150 return it->second;
151 }
152
154 return instructionRegistry.contains(instr);
155 }
156
157protected:
159 llvm::SmallDenseMap<InstructionKind, const Instruction *, 32>
161};
162
163//===----------------------------------------------------------------------===//
164// Interfaces
165//===----------------------------------------------------------------------===//
168 // Get supported Matrix shapes
170 getSupportedShapes(Type dataType, MMAOpndKind matrixType) = 0;
171 // @TODO: This method takes an context object as a parameter, this is to
172 // create the Type objects from the same context. Since type objects are
173 // uniqued in a specific context, to do things like "aType == bType" (where
174 // aType and bType are both same type) kind of checks, the both types should
175 // be from the same context.
176 //
177 // One alternative to this is to create enum to represent each types, but this
178 // adds an extra burden to user to convert these enums to specific types. In
179 // fact the utility that would convert enumToType() and vice versa would still
180 // have to use the context object.
181 //
182 // Untill we have a better solution, we stick to passing context object to
183 // this method.
185 getSupportedTypes(MLIRContext &context, MMAOpndKind matrixType) = 0;
186
190 virtual bool isLaneLayoutRowMajorOrder() const = 0;
191 virtual ~MMAInstructionInterface() = default;
192};
193
194// Interface for subgroup-level 2D block instructions (load / store / prefetch).
195// All three describe the set of hardware-supported block shapes via
196// (width, height, count) tuples and share a packed-format bit size. The
197// transform / transpose / upConv flags are only meaningful for loads; store
198// and prefetch implementations ignore them.
202
203 static bool classof(const Instruction *B) {
204 InstructionKind kind = B->getInstructionKind();
208 }
209
211 std::tuple<llvm::ArrayRef<int>, llvm::ArrayRef<int>, llvm::ArrayRef<int>>;
212
213 // Returns the supported (widths, heights, counts) for the given element
214 // type, or std::nullopt if the element type is unsupported.
215 std::optional<BlockShapes>
216 getBlockWidthHeightCount(Type elemTy, bool hasTransform = false,
217 bool hasTranspose = false,
218 bool upConv = false) const {
219 return computeBlockWidthHeightCount(elemTy, hasTransform, hasTranspose,
220 upConv);
221 }
222
223 // Bit size of the packed format used by this block instruction.
224 virtual int32_t getPackedFormatBitSize() const = 0;
225
226 virtual ~BlockIOInstructionInterface() = default;
227
228protected:
229 virtual std::optional<BlockShapes>
230 computeBlockWidthHeightCount(Type elemTy, bool hasTransform,
231 bool hasTranspose, bool upConv) const = 0;
232};
233
234//===----------------------------------------------------------------------===//
235// Common virtual ISA instructions (shared across architectures)
236//===----------------------------------------------------------------------===//
237
238//===----------------------------------------------------------------------===//
239// SPIRV
240//===----------------------------------------------------------------------===//
241template <InstructionKind Kind>
243 static_assert(Kind == InstructionKind::LoadGather ||
245 "ScatterIO only supports LoadGather / StoreScatter");
246
248
249 static bool classof(const Instruction *B) {
250 return B->getInstructionKind() == Kind;
251 }
252
253 virtual int32_t getMaxLaneAccessSizeBytes() const = 0;
255};
257 : public ScatterIoInstructionInterface<InstructionKind::LoadGather> {
258 int32_t getMaxLaneAccessSizeBytes() const override { return 16; }
259};
260
262 : public ScatterIoInstructionInterface<InstructionKind::StoreScatter> {
263 int32_t getMaxLaneAccessSizeBytes() const override { return 16; }
264};
265
266//===----------------------------------------------------------------------===//
267// SPIRV / OpenCL-extension subgroup instructions
268//
269// These come from cl_intel_subgroup_2d_block_io and
270// cl_intel_subgroup_matrix_multiply_accumulate. A uArch only needs to
271// subclass when it diverges from the extension defaults.
272//===----------------------------------------------------------------------===//
273
277 static bool classof(const Instruction *B) {
278 return B->getInstructionKind() == InstructionKind::Subgroup2DBlockStore;
279 }
280 // Source :
281 // https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroup_2d_block_io.html#_add_a_new_section_5_2_x_cl_intel_subgroup_2d_block_io
282 // Stores ignore the transform / transpose / upConv flags.
283 int32_t getPackedFormatBitSize() const override { return 16; }
284
285protected:
286 std::optional<BlockShapes>
287 computeBlockWidthHeightCount(Type elemTy, bool /*hasTransform*/,
288 bool /*hasTranspose*/,
289 bool /*upConv*/) const override {
290 static const int kHeight[] = {1, 2, 4, 8};
291 static const int kWidth16[] = {16};
292 static const int kCount[] = {1};
293 const int elemByteSize = elemTy.getIntOrFloatBitWidth() / 8;
294 if (elemByteSize == 1 || elemByteSize == 2 || elemByteSize == 4)
295 return std::make_tuple(llvm::ArrayRef<int>(kWidth16),
296 llvm::ArrayRef<int>(kHeight),
297 llvm::ArrayRef<int>(kCount));
298 return std::nullopt;
299 }
300};
301
305 static bool classof(const Instruction *B) {
306 return B->getInstructionKind() == InstructionKind::Subgroup2DBlockLoad;
307 }
308
309 // Source :
310 // https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroup_2d_block_io.html#_add_a_new_section_5_2_x_cl_intel_subgroup_2d_block_io
311 int32_t getPackedFormatBitSize() const override { return 16; }
312
313protected:
314 std::optional<BlockShapes>
315 computeBlockWidthHeightCount(Type elemTy, bool hasTransform,
316 bool hasTranspose, bool upConv) const override {
317 static const int kHeightAtLeast1[] = {1, 2, 4, 8, 16, 32};
318 static const int kHeightAtLeast8[] = {8, 16, 32};
319 static const int kHeightAtLeast16[] = {16, 32};
320 static const int kHeight32[] = {32};
321 static const int kHeight64[] = {64};
322
323 static const int kWidth64[] = {64};
324 static const int kWidth32[] = {32};
325 static const int kWidth16[] = {16};
326 static const int kWidth8[] = {8};
327
328 static const int32_t kCount1[] = {1};
329 static const int32_t kCount2[] = {1, 2};
330 static const int32_t kCount4[] = {1, 2, 4};
331 static const int32_t kCount4Only[] = {4};
332 // (elemBits, transform, transpose, upConvert)
333 using Key = std::tuple<int, uint8_t, uint8_t, uint8_t>;
334 // (widths, heights, counts)
335 using Value = std::tuple<llvm::ArrayRef<int32_t>, llvm::ArrayRef<int32_t>,
337 // The table is keyed on element bit width so sub-byte elements can be
338 // expressed directly. 4-bit elements are packed two-per-byte, so their
339 // widths (or heights, when transformed) are double the 8-bit rows.
340 static const llvm::DenseMap<Key, Value> kMap = {
341 {{8, false, false, false}, {kWidth32, kHeightAtLeast1, kCount2}},
342 {{8, false, false, true}, {kWidth16, kHeightAtLeast8, kCount4Only}},
343 {{16, false, false, false}, {kWidth16, kHeightAtLeast1, kCount2}},
344 {{32, false, false, false}, {kWidth16, kHeightAtLeast1, kCount1}},
345 // Block Loads with Transform:
346 {{8, true, false, false}, {kWidth16, kHeight32, kCount4}},
347 {{16, true, false, false}, {kWidth16, kHeightAtLeast16, kCount2}},
348 // Block Loads with Transpose:
349 {{8, false, true, false}, {kWidth32, kHeightAtLeast16, kCount1}},
350 {{16, false, true, false}, {kWidth16, kHeightAtLeast16, kCount1}},
351 {{32, false, true, false}, {kWidth8, kHeightAtLeast16, kCount1}},
352 // 4-bit elements (sub-byte):
353 {{4, false, false, false}, {kWidth64, kHeightAtLeast1, kCount2}},
354 {{4, false, false, true}, {kWidth32, kHeightAtLeast8, kCount4Only}},
355 {{4, true, false, false}, {kWidth16, kHeight64, kCount4}},
356 {{4, false, true, false}, {kWidth64, kHeightAtLeast16, kCount1}}};
357 int elemBitSize = elemTy.getIntOrFloatBitWidth();
358 auto it = kMap.find({elemBitSize, hasTransform, hasTranspose, upConv});
359 if (it != kMap.end())
360 return it->second;
361 return std::nullopt;
362 }
363};
364
368 static bool classof(const Instruction *B) {
369 return B->getInstructionKind() == InstructionKind::Subgroup2DBlockPrefetch;
370 }
371 // Source :
372 // https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroup_buffer_prefetch.html#_add_a_new_section_6_15_x_sub_group_prefetch_functions
373 // Prefetches ignore the transform / transpose / upConv flags.
374 int32_t getPackedFormatBitSize() const override { return 16; }
375
376protected:
377 std::optional<BlockShapes>
378 computeBlockWidthHeightCount(Type elemTy, bool /*hasTransform*/,
379 bool /*hasTranspose*/,
380 bool /*upConv*/) const override {
381 static const int kHeightAtLeast1[] = {1, 2, 4, 8, 16, 32};
382
383 static const int kWidth32[] = {32};
384 static const int kWidth16[] = {16};
385
386 static const int32_t kCount1[] = {1};
387 static const int32_t kCount2[] = {1, 2};
388 // elemBytes
389 using Key = int;
390 // (widths, heights, counts)
391 using Value = std::tuple<llvm::ArrayRef<int32_t>, llvm::ArrayRef<int32_t>,
393 static const llvm::DenseMap<Key, Value> kMap = {
394 {1, {kWidth32, kHeightAtLeast1, kCount2}},
395 {2, {kWidth16, kHeightAtLeast1, kCount2}},
396 {4, {kWidth16, kHeightAtLeast1, kCount1}},
397 };
398 const int elemByteSize = elemTy.getIntOrFloatBitWidth() / 8;
399 auto it = kMap.find(elemByteSize);
400 if (it != kMap.end())
401 return it->second;
402 return std::nullopt;
403 }
404};
405
414 static bool classof(const Instruction *B) {
415 return B->getInstructionKind() ==
417 }
418 // Source:
419 // https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroup_matrix_multiply_accumulate.html
420
422 getSupportedShapes(Type dataType, MMAOpndKind matrixType) override;
424 MMAOpndKind matrixType) override;
425
429
432 bool isLaneLayoutRowMajorOrder() const override { return true; }
433
434protected:
435 const unsigned packedFormatBitSizeA;
436 const unsigned packedFormatBitSizeB;
437};
438
447 static bool classof(const Instruction *B) {
448 return B->getInstructionKind() ==
450 }
451 // Source:
452 // https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_subgroup_scaled_matrix_multiply_accumulate.asciidoc
453
455 getSupportedShapes(Type dataType, MMAOpndKind matrixType) override;
457 MMAOpndKind matrixType) override;
458
462
465 bool isLaneLayoutRowMajorOrder() const override { return true; }
466
467protected:
468 const unsigned packedFormatBitSizeA;
469 const unsigned packedFormatBitSizeB;
470};
471
472//===----------------------------------------------------------------------===//
473// Inline implementations
474//===----------------------------------------------------------------------===//
475
476namespace util {
481 for (unsigned x : a)
482 for (unsigned y : b)
483 result.emplace_back(x, y);
484 return result;
485}
486} // namespace util
487
490 MMAOpndKind matrixType) {
491 auto M = getSupportedM(dataType);
492 auto K = getSupportedK(dataType);
493 auto N = getSupportedN(dataType);
494 switch (matrixType) {
496 return util::crossProduct(M, K);
498 return util::crossProduct(K, N);
501 return util::crossProduct(M, N);
502 }
503 return {};
504}
505
508 MMAOpndKind matrixType) {
509 Type bf16Type = BFloat16Type::get(&context);
510 Type f16Type = Float16Type::get(&context);
511 Type tf32Type = FloatTF32Type::get(&context);
512 Type f32Type = Float32Type::get(&context);
513
514 switch (matrixType) {
517 return {bf16Type, f16Type, tf32Type};
520 return {bf16Type, f16Type, f32Type};
521 }
522 return {};
523}
524
527 return {1, 2, 3, 4, 5, 6, 7, 8};
528}
529
532 assert(type.isIntOrFloat() && "Matrix type must be int or float");
533 auto bitWidth = type.getIntOrFloatBitWidth();
534 uint32_t kSize = 0;
535 switch (bitWidth) {
536 case 4:
537 kSize = 64;
538 break;
539 case 8:
540 kSize = 32;
541 break;
542 case 16:
543 kSize = 16;
544 break;
545 case 32:
546 kSize = 8;
547 break;
548 default:
549 llvm_unreachable("Invalid int or float");
550 }
551 return {kSize};
552}
553
556 return {16};
557}
558
561 MMAOpndKind matrixType) {
562 // Avoid calling getSupportedK for C/D types (which are f32/bf16
563 // and not valid for the K-dimension bit-width calculation).
564 switch (matrixType) {
566 return util::crossProduct(getSupportedM(dataType), getSupportedK(dataType));
568 return util::crossProduct(getSupportedK(dataType), getSupportedN(dataType));
571 return util::crossProduct(getSupportedM(dataType), getSupportedN(dataType));
572 }
573 return {};
574}
575
578 MMAOpndKind matrixType) {
579 Type f8E4M3FNType = Float8E4M3FNType::get(&context);
580 Type f8E5M2Type = Float8E5M2Type::get(&context);
581 Type f4E2M1FNType = Float4E2M1FNType::get(&context);
582 Type bf16Type = BFloat16Type::get(&context);
583 Type f32Type = Float32Type::get(&context);
584
585 switch (matrixType) {
588 return {f8E4M3FNType, f8E5M2Type, f4E2M1FNType};
591 return {bf16Type, f32Type};
592 }
593 return {};
594}
595
598 return {8};
599}
600
603 assert(type.isIntOrFloat() && "Matrix type must be int or float");
604 auto bitWidth = type.getIntOrFloatBitWidth();
605 switch (bitWidth) {
606 case 4:
607 return {64}; // FP4: scale K by 4 (base 16-bit K=16 -> 64)
608 case 8:
609 return {32}; // FP8: scale K by 2 (base 16-bit K=16 -> 32)
610 default:
611 // Scaled dpas only supports FP8 (8-bit) and FP4 (4-bit) types for A/B
612 // matrices. Return empty so callers can gracefully reject unsupported
613 // types instead of aborting.
614 return {};
615 }
616}
617
620 return {16};
621}
622
623} // namespace uArch
624} // namespace xegpu
625} // namespace mlir
626
627#endif // MLIR_DIALECT_XEGPU_UARCH_UARCHBASE_H
b
Return true if permutation is a valid permutation of the outer_dims_perm (case OuterOrInnerPerm::Oute...
MLIRContext is the top-level object for a collection of MLIR operations.
Definition MLIRContext.h:64
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Definition Types.h:74
bool isIntOrFloat() const
Return true if this is an integer (of any signedness) or a float type.
Definition Types.cpp:118
unsigned getIntOrFloatBitWidth() const
Return the bit width of an integer or a float type, assert failure on other types.
Definition Types.cpp:124
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
llvm::SmallVector< std::pair< uint32_t, uint32_t >, 16 > crossProduct(const llvm::SmallVector< uint32_t, 8 > &a, const llvm::SmallVector< uint32_t, 8 > &b)
Definition uArchBase.h:478
Include the generated interface declarations.
std::tuple< llvm::ArrayRef< int >, llvm::ArrayRef< int >, llvm::ArrayRef< int > > BlockShapes
Definition uArchBase.h:210
virtual int32_t getPackedFormatBitSize() const =0
virtual std::optional< BlockShapes > computeBlockWidthHeightCount(Type elemTy, bool hasTransform, bool hasTranspose, bool upConv) const =0
std::optional< BlockShapes > getBlockWidthHeightCount(Type elemTy, bool hasTransform=false, bool hasTranspose=false, bool upConv=false) const
Definition uArchBase.h:216
static bool classof(const Instruction *B)
Definition uArchBase.h:203
Instruction(InstructionKind kind, InstructionScope scope)
Definition uArchBase.h:58
const InstructionScope scope
Definition uArchBase.h:87
InstructionScope getScope() const
Definition uArchBase.h:64
static llvm::StringRef toString(InstructionKind instKind)
Definition uArchBase.h:65
InstructionKind getInstructionKind() const
Definition uArchBase.h:63
const InstructionKind instKind
Definition uArchBase.h:86
int32_t getMaxLaneAccessSizeBytes() const override
Definition uArchBase.h:258
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
virtual bool isLaneLayoutRowMajorOrder() const =0
virtual llvm::SmallVector< uint32_t, 8 > getSupportedK(Type type) const =0
virtual llvm::SmallVector< uint32_t, 8 > getSupportedM(Type type) const =0
virtual llvm::SmallVector< Type, 8 > getSupportedTypes(MLIRContext &context, MMAOpndKind matrixType)=0
virtual int32_t getMaxLaneAccessSizeBytes() const =0
static bool classof(const Instruction *B)
Definition uArchBase.h:249
int32_t getMaxLaneAccessSizeBytes() const override
Definition uArchBase.h:263
std::optional< BlockShapes > computeBlockWidthHeightCount(Type elemTy, bool hasTransform, bool hasTranspose, bool upConv) const override
Definition uArchBase.h:315
static bool classof(const Instruction *B)
Definition uArchBase.h:305
static bool classof(const Instruction *B)
Definition uArchBase.h:368
std::optional< BlockShapes > computeBlockWidthHeightCount(Type elemTy, bool, bool, bool) const override
Definition uArchBase.h:378
static bool classof(const Instruction *B)
Definition uArchBase.h:277
std::optional< BlockShapes > computeBlockWidthHeightCount(Type elemTy, bool, bool, bool) const override
Definition uArchBase.h:287
llvm::SmallVector< uint32_t, 8 > getSupportedK(Type type) const override
Definition uArchBase.h:531
bool isLaneLayoutRowMajorOrder() const override
Definition uArchBase.h:432
llvm::SmallVector< std::pair< uint32_t, uint32_t >, 16 > getSupportedShapes(Type dataType, MMAOpndKind matrixType) override
Definition uArchBase.h:489
llvm::SmallVector< Type, 8 > getSupportedTypes(MLIRContext &context, MMAOpndKind matrixType) override
Definition uArchBase.h:507
llvm::SmallVector< uint32_t, 8 > getSupportedN(Type type) const override
Definition uArchBase.h:555
SubgroupMatrixMultiplyAcc(unsigned packedFormatBitSizeA, unsigned packedFormatBitSizeB)
Definition uArchBase.h:408
static bool classof(const Instruction *B)
Definition uArchBase.h:414
llvm::SmallVector< uint32_t, 8 > getSupportedM(Type type) const override
Definition uArchBase.h:526
llvm::SmallVector< uint32_t, 8 > getSupportedN(Type type) const override
Definition uArchBase.h:619
llvm::SmallVector< uint32_t, 8 > getSupportedM(Type type) const override
Definition uArchBase.h:597
SubgroupScaledMatrixMultiplyAcc(unsigned packedFormatBitSizeA, unsigned packedFormatBitSizeB)
Definition uArchBase.h:441
static bool classof(const Instruction *B)
Definition uArchBase.h:447
llvm::SmallVector< std::pair< uint32_t, uint32_t >, 16 > getSupportedShapes(Type dataType, MMAOpndKind matrixType) override
Definition uArchBase.h:560
llvm::SmallVector< Type, 8 > getSupportedTypes(MLIRContext &context, MMAOpndKind matrixType) override
Definition uArchBase.h:577
llvm::SmallVector< uint32_t, 8 > getSupportedK(Type type) const override
Definition uArchBase.h:602
llvm::SmallDenseMap< InstructionKind, const Instruction *, 32 > instructionRegistry
Definition uArchBase.h:160
virtual unsigned getGeneralPackedFormatBitSize() const =0
bool isSupportedInstruction(InstructionKind instr) const
Definition uArchBase.h:153
virtual int getSubgroupSize() const =0
virtual const BlockIOMemoryRestrictions & getBlockIOMemoryRestrictions() const =0
const Instruction * getInstruction(InstructionKind instKind) const
Definition uArchBase.h:146
virtual ~uArch()=default
uArch(Kind kind, llvm::ArrayRef< const Instruction * > instructionRegistry)
Definition uArchBase.h:131