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
22#include "mlir/IR/Builders.h"
27#include "mlir/IR/SymbolTable.h"
34#include "llvm/ADT/STLExtras.h"
35
36namespace mlir {
37namespace gpu {
38/// Utility class for the GPU dialect to represent triples of `Value`s
39/// accessible through `.x`, `.y`, and `.z` similarly to CUDA notation.
45
46// Adds a `gpu.async.token` to the front of the argument list.
47void addAsyncDependency(Operation *op, Value token);
48} // namespace gpu
49} // namespace mlir
50
51#include "mlir/Dialect/GPU/IR/GPUOpInterfaces.h.inc"
52
53#define GET_OP_CLASSES
54#include "mlir/Dialect/GPU/IR/GPUOps.h.inc"
55
56namespace mlir::gpu {
57/// Retrieve the constant bounds for a given dimension and dimension kind
58/// from the context surrounding `op`, if known, and return them. This will
59/// check the bounds on an enclosing `gpu.launch`, an enclosing `gpu.func`, and
60/// any `gpu.known_*_size` on other function-like operations, in that order.
61std::optional<uint32_t>
62getKnownDimensionSizeAround(Operation *op, DimensionKind kind, Dimension dim);
63} // namespace mlir::gpu
64#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:40