MLIR 23.0.0git
AMDGPUDialect.h
Go to the documentation of this file.
1//===- AMDGPUDialect.h - MLIR Dialect for AMDGPU ---------*- 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 a dialect for MLIR wrappers around AMDGPU-specific
10// intrinsics and for other AMD GPU-specific functionality.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_DIALECT_AMDGPU_IR_AMDGPUDIALECT_H_
15#define MLIR_DIALECT_AMDGPU_IR_AMDGPUDIALECT_H_
16
20#include "mlir/IR/Dialect.h"
25
26#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h.inc"
27
29
30#include "mlir/Dialect/AMDGPU/IR/AMDGPUAttrs.h.inc"
31#include "mlir/Dialect/AMDGPU/IR/AMDGPUTypes.h.inc"
32
33namespace mlir::amdgpu {
34/// Parser for the `custom<MNKDimensionList>` custom assembly format used by
35/// WMMAOp.
36ParseResult parseMNKDimensionList(OpAsmParser &parser, IntegerAttr &m,
37 IntegerAttr &n, IntegerAttr &k);
38inline ParseResult parseMNKDimensionList(OpAsmParser &parser, Operation *,
39 IntegerAttr &m, IntegerAttr &n,
40 IntegerAttr &k) {
41 return parseMNKDimensionList(parser, m, n, k);
42}
43
44/// Printer for the `custom<MNKDimensionList>` custom assembly format used by
45/// WMMAOp.
46inline void printMNKDimensionList(OpAsmPrinter &printer, IntegerAttr m,
47 IntegerAttr n, IntegerAttr k) {
48 printer.printDimensionList(ArrayRef{m.getInt(), n.getInt(), k.getInt()});
49}
51 IntegerAttr m, IntegerAttr n, IntegerAttr k) {
52 printMNKDimensionList(printer, m, n, k);
53}
54} // namespace mlir::amdgpu
55
56#define GET_ATTRDEF_CLASSES
57#include "mlir/Dialect/AMDGPU/IR/AMDGPUAttrs.h.inc"
58
59#define GET_TYPEDEF_CLASSES
60#include "mlir/Dialect/AMDGPU/IR/AMDGPUTypes.h.inc"
61
62#define GET_OP_CLASSES
63#include "mlir/Dialect/AMDGPU/IR/AMDGPU.h.inc"
64
65#endif // MLIR_DIALECT_AMDGPU_IR_AMDGPUDIALECT_H_
void printDimensionList(ArrayRef< int64_t > shape)
The OpAsmParser has methods for interacting with the asm parser: parsing things from it,...
This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom p...
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
ParseResult parseMNKDimensionList(OpAsmParser &parser, IntegerAttr &m, IntegerAttr &n, IntegerAttr &k)
Parser for the custom<MNKDimensionList> custom assembly format used by WMMAOp.
void printMNKDimensionList(OpAsmPrinter &printer, IntegerAttr m, IntegerAttr n, IntegerAttr k)
Printer for the custom<MNKDimensionList> custom assembly format used by WMMAOp.