FLANG
FIROpenACCOpsInterfaces.h
1//===- FIROpenACCOpsInterfaces.h --------------------------------*- 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 contains external operation interfaces for FIR.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef FLANG_OPTIMIZER_OPENACC_FIROPENACC_OPS_INTERFACES_H_
14#define FLANG_OPTIMIZER_OPENACC_FIROPENACC_OPS_INTERFACES_H_
15
16#include "mlir/Dialect/OpenACC/OpenACC.h"
17
18namespace fir {
19class DeclareOp;
20} // namespace fir
21
22namespace hlfir {
23class DeclareOp;
24class DesignateOp;
25} // namespace hlfir
26
27namespace fir::acc {
28
29template <typename Op>
31 : public mlir::acc::PartialEntityAccessOpInterface::ExternalModel<
32 PartialEntityAccessModel<Op>, Op> {
33 mlir::Value getBaseEntity(mlir::Operation *op) const;
34
35 // Default implementation - returns false (partial view)
36 bool isCompleteView(mlir::Operation *op) const { return false; }
37};
38
39// Full specializations for declare operations
40template <>
41struct PartialEntityAccessModel<fir::DeclareOp>
42 : public mlir::acc::PartialEntityAccessOpInterface::ExternalModel<
43 PartialEntityAccessModel<fir::DeclareOp>, fir::DeclareOp> {
44 mlir::Value getBaseEntity(mlir::Operation *op) const;
45 bool isCompleteView(mlir::Operation *op) const;
46};
47
48template <>
49struct PartialEntityAccessModel<hlfir::DeclareOp>
50 : public mlir::acc::PartialEntityAccessOpInterface::ExternalModel<
51 PartialEntityAccessModel<hlfir::DeclareOp>, hlfir::DeclareOp> {
52 mlir::Value getBaseEntity(mlir::Operation *op) const;
53 bool isCompleteView(mlir::Operation *op) const;
54};
55
56} // namespace fir::acc
57
58#endif // FLANG_OPTIMIZER_OPENACC_FIROPENACC_OPS_INTERFACES_H_
Definition AbstractConverter.h:34
Definition FIROpenACCOpsInterfaces.h:32