MLIR
24.0.0git
include
mlir
Dialect
XeGPU
uArch
IntelGpuXe3p.h
Go to the documentation of this file.
1
//===--- IntelGpuXe3p.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
// Xe3p uArch definition. Xe3p is a derivative of the third generation of Intel
11
// Xe GPUs and includes Crescent Island (CRI). Note that plain Xe3 exposes no
12
// XeGPU-relevant differences over Xe2 and is therefore covered by
13
// IntelGpuXe2.h; only the Xe3p derivative is modelled here.
14
//
15
// The base instruction set comes from the shared Khronos OpenCL extensions
16
// defined in uArchBase.h; on top of those Xe3p adds the scaled DPAS (MXFP)
17
// extension and relaxes the 2D block memory restrictions. Subclass and override
18
// here only when an Xe3p-specific instruction diverges from the SPIRV defaults.
19
//
20
//===----------------------------------------------------------------------===//
21
#ifndef MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE3P_H
22
#define MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE3P_H
23
24
#include "
mlir/Dialect/XeGPU/uArch/uArchBase.h
"
25
26
namespace
mlir
{
27
namespace
xegpu
{
28
namespace
uArch
{
29
struct
Xe3p
:
public
uArch
{
30
Xe3p
(
Kind
kind
,
llvm::ArrayRef<const Instruction *>
instructionRegistry
)
31
:
uArch
(
kind
,
instructionRegistry
) {}
32
int
getSubgroupSize
()
const override
{
return
16; }
33
unsigned
getGeneralPackedFormatBitSize
()
const override
{
return
32; }
34
35
// Restrictions Xe3p places on the 2D memory region accessed by the subgroup
36
// 2D block load / store / prefetch instructions.
37
//
38
// Xe3p relaxes every one of these relative to Xe2, which requires a 64 byte
39
// aligned base address, a base width and pitch of at least 32 bytes, and a
40
// pitch that is a multiple of 16 bytes. On Xe3p the base address, width and
41
// pitch all only need to be a multiple of 4 bytes. There is no minimum size
42
// restriction on the width or the pitch, so their minimum is just that 4 byte
43
// granularity -- a zero-sized surface would be meaningless.
44
const
BlockIOMemoryRestrictions
&
45
getBlockIOMemoryRestrictions
()
const override
{
46
static
constexpr
BlockIOMemoryRestrictions
restrictions = {
47
/*baseAddressAlignmentBytes=*/
4,
48
/*minBaseWidthBytes=*/
4,
49
/*baseWidthAlignmentBytes=*/
4,
50
/*minBasePitchBytes=*/
4,
51
/*basePitchAlignmentBytes=*/
4,
52
};
53
return
restrictions;
54
}
55
56
static
bool
classof
(
const
uArch
*u) {
57
return
u->getKind() >=
Kind::Xe3p_First
&& u->getKind() <=
Kind::Xe3p_Last
;
58
}
59
};
60
61
//===----------------------------------------------------------------------===//
62
// uArch instances
63
//===----------------------------------------------------------------------===//
64
65
namespace
detail
{
66
inline
llvm::ArrayRef<const Instruction *>
getXe3pInstructionRegistry
() {
67
static
const
SubgroupMatrixMultiplyAcc
dpasInst{16, 32};
68
static
const
SubgroupScaledMatrixMultiplyAcc
dpasMxInst{16, 32};
69
static
const
Subgroup2DBlockLoadInstruction
loadNdInst;
70
static
const
Subgroup2DBlockStoreInstruction
storeNdInst;
71
static
const
Subgroup2DBlockPrefetchInstruction
prefetchNdInst;
72
static
const
StoreScatterInstruction
storeScatterInst;
73
static
const
LoadGatherInstruction
loadGatherInst;
74
static
const
Instruction
*arr[] = {
75
&dpasInst, &dpasMxInst, &loadNdInst, &storeNdInst,
76
&prefetchNdInst, &storeScatterInst, &loadGatherInst};
77
return
arr;
78
}
79
}
// namespace detail
80
81
struct
CRIuArch
final :
public
Xe3p
{
82
CRIuArch
() :
Xe3p
(
Kind
::
CRI
,
detail
::getXe3pInstructionRegistry()) {}
83
static
bool
classof
(
const
uArch
*u) {
return
u->getKind() ==
Kind::CRI
; }
84
static
const
uArch
*
getInstance
() {
85
static
const
CRIuArch
instance;
86
return
&instance;
87
}
88
};
89
}
// namespace uArch
90
}
// namespace xegpu
91
}
// namespace mlir
92
93
#endif
// MLIR_DIALECT_XEGPU_UARCH_INTELGPUXE3P_H
llvm::ArrayRef
Definition
LLVM.h:40
mlir::xegpu::detail
Definition
XeGPUContiguityAnalysis.cpp:49
mlir::xegpu::uArch::detail
Definition
IntelGpuXe2.h:66
mlir::xegpu::uArch::detail::getXe3pInstructionRegistry
llvm::ArrayRef< const Instruction * > getXe3pInstructionRegistry()
Definition
IntelGpuXe3p.h:66
mlir::xegpu::uArch
Definition
IntelGpuXe2.h:22
mlir::xegpu
Definition
XeGPU.h:25
mlir
Include the generated interface declarations.
Definition
ABIRewriteContext.h:32
mlir::xegpu::uArch::BlockIOMemoryRestrictions
Definition
uArchBase.h:101
mlir::xegpu::uArch::CRIuArch::getInstance
static const uArch * getInstance()
Definition
IntelGpuXe3p.h:84
mlir::xegpu::uArch::CRIuArch::classof
static bool classof(const uArch *u)
Definition
IntelGpuXe3p.h:83
mlir::xegpu::uArch::CRIuArch::CRIuArch
CRIuArch()
Definition
IntelGpuXe3p.h:82
mlir::xegpu::uArch::Instruction
Definition
uArchBase.h:57
mlir::xegpu::uArch::LoadGatherInstruction
Definition
uArchBase.h:257
mlir::xegpu::uArch::StoreScatterInstruction
Definition
uArchBase.h:262
mlir::xegpu::uArch::Subgroup2DBlockLoadInstruction
Definition
uArchBase.h:302
mlir::xegpu::uArch::Subgroup2DBlockPrefetchInstruction
Definition
uArchBase.h:365
mlir::xegpu::uArch::Subgroup2DBlockStoreInstruction
Definition
uArchBase.h:274
mlir::xegpu::uArch::SubgroupMatrixMultiplyAcc
Definition
uArchBase.h:407
mlir::xegpu::uArch::SubgroupScaledMatrixMultiplyAcc
Definition
uArchBase.h:440
mlir::xegpu::uArch::Xe3p::Xe3p
Xe3p(Kind kind, llvm::ArrayRef< const Instruction * > instructionRegistry)
Definition
IntelGpuXe3p.h:30
mlir::xegpu::uArch::Xe3p::getBlockIOMemoryRestrictions
const BlockIOMemoryRestrictions & getBlockIOMemoryRestrictions() const override
Definition
IntelGpuXe3p.h:45
mlir::xegpu::uArch::Xe3p::getSubgroupSize
int getSubgroupSize() const override
Definition
IntelGpuXe3p.h:32
mlir::xegpu::uArch::Xe3p::classof
static bool classof(const uArch *u)
Definition
IntelGpuXe3p.h:56
mlir::xegpu::uArch::Xe3p::getGeneralPackedFormatBitSize
unsigned getGeneralPackedFormatBitSize() const override
Definition
IntelGpuXe3p.h:33
mlir::xegpu::uArch::uArch
Definition
uArchBase.h:117
mlir::xegpu::uArch::uArch::instructionRegistry
llvm::SmallDenseMap< InstructionKind, const Instruction *, 32 > instructionRegistry
Definition
uArchBase.h:160
mlir::xegpu::uArch::uArch::kind
Kind kind
Definition
uArchBase.h:158
mlir::xegpu::uArch::uArch::Kind
Kind
Definition
uArchBase.h:118
mlir::xegpu::uArch::uArch::Kind::Xe3p_Last
@ Xe3p_Last
Definition
uArchBase.h:127
mlir::xegpu::uArch::uArch::Kind::Xe3p_First
@ Xe3p_First
Definition
uArchBase.h:125
mlir::xegpu::uArch::uArch::Kind::CRI
@ CRI
Definition
uArchBase.h:126
mlir::xegpu::uArch::uArch::uArch
uArch(Kind kind, llvm::ArrayRef< const Instruction * > instructionRegistry)
Definition
uArchBase.h:131
uArchBase.h
Generated on
for MLIR by
1.14.0