MLIR 23.0.0git
IntelGpuXe2.h
Go to the documentation of this file.
1//===--- IntelGpuXe2.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// Xe2 uArch definition. Xe2 is the second generation of Intel Xe GPUs.
11// This file defines the uArch details for Xe2 and its derived architectures.
12// This includes Ponte Vecchio (PVC) and Battlemage (BMG) architectures.
13//
14//===----------------------------------------------------------------------===//
15#ifndef MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE2_H
16#define MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE2_H
17
19
20namespace mlir {
21namespace xegpu {
22namespace uArch {
23
24struct Xe2 : public uArch {
27 int getSubgroupSize() const override { return 16; }
28 unsigned getGeneralPackedFormatBitSize() const override { return 32; }
29
30 static bool classof(const uArch *u) {
31 return u->getKind() >= Kind::Xe2_First && u->getKind() <= Kind::Xe2_Last;
32 }
33};
34
35//===----------------------------------------------------------------------===//
36// uArch instances
37//
38// PVC and BMG share the same Khronos-extension instruction set.
39//===----------------------------------------------------------------------===//
40
41namespace detail {
43 static const SubgroupMatrixMultiplyAcc dpasInst{16, 32};
44 static const Subgroup2DBlockLoadInstruction loadNdInst;
45 static const Subgroup2DBlockStoreInstruction storeNdInst;
46 static const Subgroup2DBlockPrefetchInstruction prefetchNdInst;
47 static const StoreScatterInstruction storeScatterInst;
48 static const LoadGatherInstruction loadGatherInst;
49 static const Instruction *arr[] = {&dpasInst, &loadNdInst,
50 &storeNdInst, &prefetchNdInst,
51 &storeScatterInst, &loadGatherInst};
52 return arr;
53}
54} // namespace detail
55
56struct PVCuArch final : public Xe2 {
57 PVCuArch() : Xe2(Kind::PVC, detail::getXe2InstructionRegistry()) {}
58 static bool classof(const uArch *u) { return u->getKind() == Kind::PVC; }
59 static const uArch *getInstance() {
60 static const PVCuArch instance;
61 return &instance;
62 }
63};
64
65struct BMGuArch final : public Xe2 {
66 BMGuArch() : Xe2(Kind::BMG, detail::getXe2InstructionRegistry()) {}
67 static bool classof(const uArch *u) { return u->getKind() == Kind::BMG; }
68 static const uArch *getInstance() {
69 static const BMGuArch instance;
70 return &instance;
71 }
72};
73
74} // namespace uArch
75} // namespace xegpu
76} // namespace mlir
77
78#endif // MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE2_H
llvm::ArrayRef< const Instruction * > getXe2InstructionRegistry()
Definition IntelGpuXe2.h:42
Include the generated interface declarations.
static bool classof(const uArch *u)
Definition IntelGpuXe2.h:67
static const uArch * getInstance()
Definition IntelGpuXe2.h:68
static bool classof(const uArch *u)
Definition IntelGpuXe2.h:58
static const uArch * getInstance()
Definition IntelGpuXe2.h:59
int getSubgroupSize() const override
Definition IntelGpuXe2.h:27
unsigned getGeneralPackedFormatBitSize() const override
Definition IntelGpuXe2.h:28
static bool classof(const uArch *u)
Definition IntelGpuXe2.h:30
Xe2(Kind kind, llvm::ArrayRef< const Instruction * > instructionRegistry)
Definition IntelGpuXe2.h:25
llvm::SmallDenseMap< InstructionKind, const Instruction *, 32 > instructionRegistry
Definition uArchBase.h:129
uArch(Kind kind, llvm::ArrayRef< const Instruction * > instructionRegistry)
Definition uArchBase.h:104