MLIR  21.0.0git
NVGPUDialect.h
Go to the documentation of this file.
1 //===- NVGPUDialect.h - MLIR Dialect for NVGPU ------------------*- 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 // This file declares the Target dialect for NVGPU in MLIR.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_NVGPU_NVGPUDIALECT_H_
14 #define MLIR_DIALECT_NVGPU_NVGPUDIALECT_H_
15 
17 #include "mlir/IR/BuiltinTypes.h"
18 #include "mlir/IR/Dialect.h"
19 #include "mlir/IR/OpDefinition.h"
22 
23 #include "mlir/Dialect/NVGPU/IR/NVGPUEnums.h.inc"
24 
25 // Maximum warp size
26 constexpr int kWarpSize = 32;
27 
28 // Maximum number of threads in a block and block in a grid
29 // https://docs.nvidia.com/cuda/cuda-c-programming-guide/#features-and-technical-specifications-technical-specifications-per-compute-capability
30 constexpr int kMaxTotalBlockdim = 1024;
31 constexpr int kMaxBlockdimx = 1024;
32 constexpr int kMaxBlockdimy = 1024;
33 constexpr int kMaxBlockdimz = 64;
34 constexpr int kMaxTotalGriddim = 2147483647;
35 constexpr int kMaxGriddimx = 2147483647;
36 constexpr int kMaxGriddimy = 65535;
37 constexpr int kMaxGriddimz = 65535;
38 
39 /// M size of wgmma.mma_async instruction
40 constexpr int kWgmmaSizeM = 64;
41 
42 /// Maximum TMA tile dimension (tensorRank) must be non-zero and less than or
43 /// equal to the maximum supported dimensionality of 5.
44 constexpr unsigned kMaxTMATensorDimension = 5;
45 /// Maximum TMA tile size (boxDim), which specifies number of elements
46 /// to be traversed along each of the kMaxTMATensorDimension (tensorRank)
47 /// dimensions, must be non-zero and less than or equal to 256.
48 constexpr unsigned kMaxTMADimension = 256;
49 /// Last dimension of 2D+ TMA must be 128 bytes
50 constexpr unsigned kMaxTMALastdimByte = 128;
51 
52 #define GET_ATTRDEF_CLASSES
53 #include "mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.h.inc"
54 
55 #define GET_TYPEDEF_CLASSES
56 #include "mlir/Dialect/NVGPU/IR/NVGPUTypeDefs.h.inc"
57 
58 #include "mlir/Dialect/NVGPU/IR/NVGPUDialect.h.inc"
59 
60 #define GET_OP_CLASSES
61 #include "mlir/Dialect/NVGPU/IR/NVGPUOps.h.inc"
62 
63 #endif // MLIR_DIALECT_NVGPU_NVGPUDIALECT_H_
constexpr int kMaxGriddimz
Definition: NVGPUDialect.h:37
constexpr int kMaxTotalBlockdim
Definition: NVGPUDialect.h:30
constexpr int kWgmmaSizeM
M size of wgmma.mma_async instruction.
Definition: NVGPUDialect.h:40
constexpr int kWarpSize
Definition: NVGPUDialect.h:26
constexpr int kMaxGriddimy
Definition: NVGPUDialect.h:36
constexpr unsigned kMaxTMATensorDimension
Maximum TMA tile dimension (tensorRank) must be non-zero and less than or equal to the maximum suppor...
Definition: NVGPUDialect.h:44
constexpr int kMaxBlockdimx
Definition: NVGPUDialect.h:31
constexpr int kMaxBlockdimz
Definition: NVGPUDialect.h:33
constexpr int kMaxGriddimx
Definition: NVGPUDialect.h:35
constexpr unsigned kMaxTMADimension
Maximum TMA tile size (boxDim), which specifies number of elements to be traversed along each of the ...
Definition: NVGPUDialect.h:48
constexpr int kMaxBlockdimy
Definition: NVGPUDialect.h:32
constexpr unsigned kMaxTMALastdimByte
Last dimension of 2D+ TMA must be 128 bytes.
Definition: NVGPUDialect.h:50
constexpr int kMaxTotalGriddim
Definition: NVGPUDialect.h:34