MLIR  20.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  /// Constant memory space identifier.
41 };
42 
43 /// Return the element type and number of elements associated with a wmma matrix
44 /// of given chracteristics. This matches the logic in IntrinsicsNVVM.td
45 /// WMMA_REGS structure.
46 std::pair<mlir::Type, unsigned> inferMMAType(mlir::NVVM::MMATypes type,
47  mlir::NVVM::MMAFrag frag, int nRow,
48  int nCol,
49  mlir::MLIRContext *context);
50 } // namespace NVVM
51 } // namespace mlir
52 
53 ///// Ops /////
54 #define GET_ATTRDEF_CLASSES
55 #include "mlir/Dialect/LLVMIR/NVVMOpsAttributes.h.inc"
56 
57 #define GET_OP_CLASSES
58 #include "mlir/Dialect/LLVMIR/NVVMOps.h.inc"
59 
60 #include "mlir/Dialect/LLVMIR/NVVMOpsDialect.h.inc"
61 
62 #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
@ kConstantMemorySpace
Constant memory space identifier.
Definition: NVVMDialect.h:40
@ 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.