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