MLIR  19.0.0git
NVVMDialect.h
Go to the documentation of this file.
1 //===- NVVMDialect.h - MLIR NVVM IR dialect ---------------------*- 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 defines the NVVM IR dialect in MLIR, containing NVVM operations and
10 // NVVM specific extensions to the LLVM type system.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef MLIR_DIALECT_LLVMIR_NVVMDIALECT_H_
15 #define MLIR_DIALECT_LLVMIR_NVVMDIALECT_H_
16 
20 #include "mlir/IR/Dialect.h"
21 #include "mlir/IR/OpDefinition.h"
23 #include "llvm/IR/IntrinsicsNVPTX.h"
24 
25 #include "mlir/Dialect/LLVMIR/NVVMOpsEnums.h.inc"
26 
27 namespace mlir {
28 namespace NVVM {
29 
30 // Shared memory has 128-bit alignment
31 constexpr int kSharedMemoryAlignmentBit = 128;
32 
33 /// NVVM memory space identifiers.
35  /// Global memory space identifier.
37  /// Shared memory space identifier.
39 };
40 
41 /// Return the element type and number of elements associated with a wmma matrix
42 /// of given chracteristics. This matches the logic in IntrinsicsNVVM.td
43 /// WMMA_REGS structure.
44 std::pair<mlir::Type, unsigned> inferMMAType(mlir::NVVM::MMATypes type,
45  mlir::NVVM::MMAFrag frag, int nRow,
46  int nCol,
47  mlir::MLIRContext *context);
48 } // namespace NVVM
49 } // namespace mlir
50 
51 ///// Ops /////
52 #define GET_ATTRDEF_CLASSES
53 #include "mlir/Dialect/LLVMIR/NVVMOpsAttributes.h.inc"
54 
55 #define GET_OP_CLASSES
56 #include "mlir/Dialect/LLVMIR/NVVMOps.h.inc"
57 
58 #include "mlir/Dialect/LLVMIR/NVVMOpsDialect.h.inc"
59 
60 #endif /* MLIR_DIALECT_LLVMIR_NVVMDIALECT_H_ */
MLIRContext is the top-level object for a collection of MLIR operations.
Definition: MLIRContext.h:60
constexpr int kSharedMemoryAlignmentBit
Definition: NVVMDialect.h:31
NVVMMemorySpace
NVVM memory space identifiers.
Definition: NVVMDialect.h:34
@ kGlobalMemorySpace
Global memory space identifier.
Definition: NVVMDialect.h:36
@ kSharedMemorySpace
Shared memory space identifier.
Definition: NVVMDialect.h:38
std::pair< mlir::Type, unsigned > inferMMAType(mlir::NVVM::MMATypes type, mlir::NVVM::MMAFrag frag, int nRow, int nCol, mlir::MLIRContext *context)
Return the element type and number of elements associated with a wmma matrix of given chracteristics.
Include the generated interface declarations.