MLIR 24.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
22#include "llvm/IR/IntrinsicsNVPTX.h"
23
24namespace mlir {
25namespace NVVM {
26// Shared memory has 128-bit alignment
27constexpr int kSharedMemoryAlignmentBit = 128;
28
29/// A pair type of LLVM's Intrinsic ID and args (which are llvm values).
30/// This type is returned by the getIntrinsicIDAndArgs() methods.
31using IDArgPair =
32 std::pair<llvm::Intrinsic::ID, llvm::SmallVector<llvm::Value *>>;
33
34/// Return the element type and number of elements associated with a wmma matrix
35/// of given chracteristics. This matches the logic in IntrinsicsNVVM.td
36/// WMMA_REGS structure.
37std::pair<mlir::Type, unsigned> inferMMAType(mlir::NVVM::MMATypes type,
38 mlir::NVVM::MMAFrag frag, int nRow,
39 int nCol,
40 mlir::MLIRContext *context);
41} // namespace NVVM
42namespace LLVM {
43class ModuleTranslation;
44} // namespace LLVM
45} // namespace mlir
46
47#define GET_OP_CLASSES
48#include "mlir/Dialect/LLVMIR/NVVMOps.h.inc"
49
50#endif /* MLIR_DIALECT_LLVMIR_NVVMDIALECT_H_ */
MLIRContext is the top-level object for a collection of MLIR operations.
Definition MLIRContext.h:71
constexpr int kSharedMemoryAlignmentBit
Definition NVVMDialect.h:27
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.
std::pair< llvm::Intrinsic::ID, llvm::SmallVector< llvm::Value * > > IDArgPair
A pair type of LLVM's Intrinsic ID and args (which are llvm values).
Definition NVVMDialect.h:31
Include the generated interface declarations.