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