MLIR 24.0.0git
GPUDialect.h
Go to the documentation of this file.
1//===- GPUDialect.h - MLIR Dialect for GPU Kernels --------------*- 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 GPU kernel-related operations and puts them in the
10// corresponding dialect.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_DIALECT_GPU_IR_GPUDIALECT_H
15#define MLIR_DIALECT_GPU_IR_GPUDIALECT_H
16
21#include "mlir/IR/Builders.h"
23#include "llvm/ADT/STLExtras.h"
24
25namespace mlir {
26namespace gpu {
27/// Utility class for the GPU dialect to represent triples of `Value`s
28/// accessible through `.x`, `.y`, and `.z` similarly to CUDA notation.
34
35// Adds a `gpu.async.token` to the front of the argument list.
36void addAsyncDependency(Operation *op, Value token);
37} // namespace gpu
38} // namespace mlir
39
40#include "mlir/Dialect/GPU/IR/GPUOpInterfaces.h.inc"
41
42#define GET_OP_CLASSES
43#include "mlir/Dialect/GPU/IR/GPUOps.h.inc"
44
45namespace mlir::gpu {
46/// Retrieve the constant bounds for a given dimension and dimension kind
47/// from the context surrounding `op`, if known, and return them. This will
48/// check the bounds on an enclosing `gpu.launch`, an enclosing `gpu.func`, and
49/// any `gpu.known_*_size` on other function-like operations, in that order.
50std::optional<uint32_t>
51getKnownDimensionSizeAround(Operation *op, DimensionKind kind, Dimension dim);
52} // namespace mlir::gpu
53#endif // MLIR_DIALECT_GPU_IR_GPUDIALECT_H
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96
std::optional< uint32_t > getKnownDimensionSizeAround(Operation *op, DimensionKind kind, Dimension dim)
Retrieve the constant bounds for a given dimension and dimension kind from the context surrounding op...
void addAsyncDependency(Operation *op, Value token)
Include the generated interface declarations.
Utility class for the GPU dialect to represent triples of Values accessible through ....
Definition GPUDialect.h:29