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