MLIR 23.0.0git
OpenACCUtilsCG.h
Go to the documentation of this file.
1//===- OpenACCUtilsCG.h - OpenACC Code Generation Utilities -----*- 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 utility functions for OpenACC code generation, including
10// data layout and type-related utilities.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef MLIR_DIALECT_OPENACC_OPENACCUTILSCG_H_
15#define MLIR_DIALECT_OPENACC_OPENACCUTILSCG_H_
16
18#include <optional>
19
20namespace mlir {
21class Operation;
22
23namespace acc {
24
25/// Get the data layout for an operation.
26///
27/// Attempts to get the data layout from the operation or its parent module.
28/// If `allowDefault` is true (default), a default data layout may be
29/// constructed when no explicit data layout spec is found.
30///
31/// \param op The operation to get the data layout for.
32/// \param allowDefault If true, allow returning a default data layout.
33/// \return The data layout if available, std::nullopt otherwise.
34std::optional<DataLayout> getDataLayout(Operation *op,
35 bool allowDefault = true);
36
37} // namespace acc
38} // namespace mlir
39
40#endif // MLIR_DIALECT_OPENACC_OPENACCUTILSCG_H_
Operation is the basic unit of execution within MLIR.
Definition Operation.h:88
std::optional< DataLayout > getDataLayout(Operation *op, bool allowDefault=true)
Get the data layout for an operation.
Include the generated interface declarations.