MLIR 22.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
18#include "mlir/IR/Dialect.h"
22
23#include "mlir/Dialect/NVGPU/IR/NVGPUEnums.h.inc"
24
25// Maximum warp size
26constexpr 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
30constexpr int kMaxTotalBlockdim = 1024;
31constexpr int kMaxBlockdimx = 1024;
32constexpr int kMaxBlockdimy = 1024;
33constexpr int kMaxBlockdimz = 64;
34constexpr int kMaxTotalGriddim = 2147483647;
35constexpr int kMaxGriddimx = 2147483647;
36constexpr int kMaxGriddimy = 65535;
37constexpr int kMaxGriddimz = 65535;
38
39/// M size of wgmma.mma_async instruction
40constexpr 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.
44constexpr 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.
48constexpr unsigned kMaxTMADimension = 256;
49/// The bytes in the last dimension of the tensor map must be a multiple of 16.
50constexpr unsigned kTMALastdimByte = 16;
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
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