MLIR 24.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
19#include "mlir/IR/Dialect.h"
20
21#include "mlir/Dialect/NVGPU/IR/NVGPUEnums.h.inc"
22
23// Maximum warp size
24constexpr int kWarpSize = 32;
25
26// Maximum number of threads in a block and block in a grid
27// https://docs.nvidia.com/cuda/cuda-c-programming-guide/#features-and-technical-specifications-technical-specifications-per-compute-capability
28constexpr int kMaxTotalBlockdim = 1024;
29constexpr int kMaxBlockdimx = 1024;
30constexpr int kMaxBlockdimy = 1024;
31constexpr int kMaxBlockdimz = 64;
32constexpr int kMaxTotalGriddim = 2147483647;
33constexpr int kMaxGriddimx = 2147483647;
34constexpr int kMaxGriddimy = 65535;
35constexpr int kMaxGriddimz = 65535;
36
37/// M size of wgmma.mma_async instruction
38constexpr int kWgmmaSizeM = 64;
39
40/// Maximum TMA tile dimension (tensorRank) must be non-zero and less than or
41/// equal to the maximum supported dimensionality of 5.
42constexpr unsigned kMaxTMATensorDimension = 5;
43/// Maximum TMA tile size (boxDim), which specifies number of elements
44/// to be traversed along each of the kMaxTMATensorDimension (tensorRank)
45/// dimensions, must be non-zero and less than or equal to 256.
46constexpr unsigned kMaxTMADimension = 256;
47/// The bytes in the last dimension of the tensor map must be a multiple of 16.
48constexpr unsigned kTMALastdimByte = 16;
49
50#define GET_ATTRDEF_CLASSES
51#include "mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.h.inc"
52
53#define GET_TYPEDEF_CLASSES
54#include "mlir/Dialect/NVGPU/IR/NVGPUTypeDefs.h.inc"
55
56#define GET_OP_CLASSES
57#include "mlir/Dialect/NVGPU/IR/NVGPUOps.h.inc"
58
59#endif // MLIR_DIALECT_NVGPU_NVGPUDIALECT_H_
constexpr int kMaxGriddimz
constexpr int kMaxTotalBlockdim
constexpr unsigned kTMALastdimByte
The bytes in the last dimension of the tensor map must be a multiple of 16.
constexpr int kWgmmaSizeM
M size of wgmma.mma_async instruction.
constexpr int kWarpSize
constexpr int kMaxGriddimy
constexpr unsigned kMaxTMATensorDimension
Maximum TMA tile dimension (tensorRank) must be non-zero and less than or equal to the maximum suppor...
constexpr int kMaxBlockdimx
constexpr int kMaxBlockdimz
constexpr int kMaxGriddimx
constexpr unsigned kMaxTMADimension
Maximum TMA tile size (boxDim), which specifies number of elements to be traversed along each of the ...
constexpr int kMaxBlockdimy
constexpr int kMaxTotalGriddim