MLIR 22.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
19#include "mlir/IR/Dialect.h"
24
25#include "mlir/Dialect/AMDGPU/IR/AMDGPUDialect.h.inc"
26
27#include "mlir/Dialect/AMDGPU/IR/AMDGPUEnums.h.inc"
28
29namespace mlir::amdgpu {
30/// Parser for the `custom<MNKDimensionList>` custom assembly format used by
31/// WMMAOp.
32ParseResult parseMNKDimensionList(OpAsmParser &parser, IntegerAttr &m,
33 IntegerAttr &n, IntegerAttr &k);
34inline ParseResult parseMNKDimensionList(OpAsmParser &parser, Operation *,
35 IntegerAttr &m, IntegerAttr &n,
36 IntegerAttr &k) {
37 return parseMNKDimensionList(parser, m, n, k);
38}
39
40/// Printer for the `custom<MNKDimensionList>` custom assembly format used by
41/// WMMAOp.
42inline void printMNKDimensionList(OpAsmPrinter &printer, IntegerAttr m,
43 IntegerAttr n, IntegerAttr k) {
44 printer.printDimensionList(ArrayRef{m.getInt(), n.getInt(), k.getInt()});
45}
47 IntegerAttr m, IntegerAttr n, IntegerAttr k) {
48 printMNKDimensionList(printer, m, n, k);
49}
50} // namespace mlir::amdgpu
51
52#define GET_ATTRDEF_CLASSES
53#include "mlir/Dialect/AMDGPU/IR/AMDGPUAttributes.h.inc"
54
55#define GET_OP_CLASSES
56#include "mlir/Dialect/AMDGPU/IR/AMDGPU.h.inc"
57
58#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:88
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.