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