MLIR 23.0.0git
IntelGpuXe3.h
Go to the documentation of this file.
1//===--- IntelGpuXe3.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// Xe3 uArch definition. Xe3 is the third generation of Intel Xe GPUs and
11// includes Crescent Island (CRI). The base instruction set comes from the
12// shared Khronos OpenCL extensions defined in uArchBase.h; Xe3 only adds the
13// scaled DPAS extension. Subclass and override here only when a CRI-specific
14// instruction diverges from the SPIRV defaults.
15//
16//===----------------------------------------------------------------------===//
17#ifndef MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE3_H
18#define MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE3_H
19
21
22namespace mlir {
23namespace xegpu {
24namespace uArch {
25
26struct Xe3 : public uArch {
29 int getSubgroupSize() const override { return 16; }
30 unsigned getGeneralPackedFormatBitSize() const override { return 32; }
31
32 static bool classof(const uArch *u) {
33 return u->getKind() >= Kind::Xe3_First && u->getKind() <= Kind::Xe3_Last;
34 }
35};
36
37//===----------------------------------------------------------------------===//
38// uArch instances
39//===----------------------------------------------------------------------===//
40
41struct CRIuArch final : public Xe3 {
43 static const SubgroupMatrixMultiplyAcc dpasInst{16, 32};
44 static const SubgroupScaledMatrixMultiplyAcc dpasMxInst{16, 32};
45 static const Subgroup2DBlockLoadInstruction loadNdInst;
46 static const Subgroup2DBlockStoreInstruction storeNdInst;
47 static const Subgroup2DBlockPrefetchInstruction prefetchNdInst;
48 static const StoreScatterInstruction storeScatterInst;
49 static const LoadGatherInstruction loadGatherInst;
50 static const Instruction *arr[] = {
51 &dpasInst, &dpasMxInst, &loadNdInst, &storeNdInst,
52 &prefetchNdInst, &storeScatterInst, &loadGatherInst};
53 return arr;
54 }
55
57 static bool classof(const uArch *u) { return u->getKind() == Kind::CRI; }
58 static const uArch *getInstance() {
59 static const CRIuArch instance;
60 return &instance;
61 }
62};
63
64} // namespace uArch
65} // namespace xegpu
66} // namespace mlir
67
68#endif // MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE3_H
Include the generated interface declarations.
static const uArch * getInstance()
Definition IntelGpuXe3.h:58
static bool classof(const uArch *u)
Definition IntelGpuXe3.h:57
static llvm::ArrayRef< const Instruction * > getCriInstructionRegistry()
Definition IntelGpuXe3.h:42
Xe3(Kind kind, llvm::ArrayRef< const Instruction * > instructionRegistry)
Definition IntelGpuXe3.h:27
static bool classof(const uArch *u)
Definition IntelGpuXe3.h:32
int getSubgroupSize() const override
Definition IntelGpuXe3.h:29
unsigned getGeneralPackedFormatBitSize() const override
Definition IntelGpuXe3.h:30
llvm::SmallDenseMap< InstructionKind, const Instruction *, 32 > instructionRegistry
Definition uArchBase.h:129
uArch(Kind kind, llvm::ArrayRef< const Instruction * > instructionRegistry)
Definition uArchBase.h:104