13 #ifndef MLIR_DIALECT_OPENACC_OPENACC_H_
14 #define MLIR_DIALECT_OPENACC_OPENACC_H_
23 #include "mlir/Dialect/OpenACC/OpenACCOpsDialect.h.inc"
24 #include "mlir/Dialect/OpenACC/OpenACCOpsEnums.h.inc"
25 #include "mlir/Dialect/OpenACC/OpenACCTypeInterfaces.h.inc"
31 #define GET_TYPEDEF_CLASSES
32 #include "mlir/Dialect/OpenACC/OpenACCOpsTypes.h.inc"
34 #define GET_ATTRDEF_CLASSES
35 #include "mlir/Dialect/OpenACC/OpenACCOpsAttributes.h.inc"
39 #define GET_OP_CLASSES
40 #include "mlir/Dialect/OpenACC/OpenACCOps.h.inc"
42 #define ACC_DATA_ENTRY_OPS \
43 mlir::acc::CopyinOp, mlir::acc::CreateOp, mlir::acc::PresentOp, \
44 mlir::acc::NoCreateOp, mlir::acc::AttachOp, mlir::acc::DevicePtrOp, \
45 mlir::acc::GetDevicePtrOp, mlir::acc::PrivateOp, \
46 mlir::acc::FirstprivateOp, mlir::acc::UpdateDeviceOp, \
47 mlir::acc::UseDeviceOp, mlir::acc::ReductionOp, \
48 mlir::acc::DeclareDeviceResidentOp, mlir::acc::DeclareLinkOp, \
50 #define ACC_DATA_EXIT_OPS \
51 mlir::acc::CopyoutOp, mlir::acc::DeleteOp, mlir::acc::DetachOp, \
52 mlir::acc::UpdateHostOp
53 #define ACC_DATA_CLAUSE_OPS ACC_DATA_ENTRY_OPS, ACC_DATA_EXIT_OPS
54 #define ACC_COMPUTE_CONSTRUCT_OPS \
55 mlir::acc::ParallelOp, mlir::acc::KernelsOp, mlir::acc::SerialOp
56 #define ACC_COMPUTE_CONSTRUCT_AND_LOOP_OPS \
57 ACC_COMPUTE_CONSTRUCT_OPS, mlir::acc::LoopOp
58 #define OPENACC_DATA_CONSTRUCT_STRUCTURED_OPS \
59 mlir::acc::DataOp, mlir::acc::DeclareOp
60 #define ACC_DATA_CONSTRUCT_UNSTRUCTURED_OPS \
61 mlir::acc::EnterDataOp, mlir::acc::ExitDataOp, mlir::acc::UpdateOp, \
62 mlir::acc::HostDataOp, mlir::acc::DeclareEnterOp, \
63 mlir::acc::DeclareExitOp
64 #define ACC_DATA_CONSTRUCT_OPS \
65 OPENACC_DATA_CONSTRUCT_STRUCTURED_OPS, ACC_DATA_CONSTRUCT_UNSTRUCTURED_OPS
66 #define ACC_COMPUTE_AND_DATA_CONSTRUCT_OPS \
67 ACC_COMPUTE_CONSTRUCT_OPS, ACC_DATA_CONSTRUCT_OPS
68 #define ACC_COMPUTE_LOOP_AND_DATA_CONSTRUCT_OPS \
69 ACC_COMPUTE_CONSTRUCT_AND_LOOP_OPS, ACC_DATA_CONSTRUCT_OPS
109 std::optional<mlir::acc::DataClause>
125 return StringLiteral(
"acc.declare");
129 return StringLiteral(
"acc.declare_action");
133 return StringLiteral(
"acc.routine_info");
137 return CombinedConstructsTypeAttr::name;
142 mlir::StringRef
getName() final {
return "AccRuntimeCounters"; }
147 mlir::StringRef
getName() final {
return "AccConstructResource"; }
This class provides a mutable adaptor for a range of operands.
Operation is the basic unit of execution within MLIR.
This base class is used for derived effects that are non-parametric.
This class provides an abstraction over the different types of ranges over Values.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
mlir::Value getVarPtr(mlir::Operation *accDataClauseOp)
Used to obtain the varPtr from a data clause operation.
std::optional< mlir::acc::DataClause > getDataClause(mlir::Operation *accDataEntryOp)
Used to obtain the dataClause from a data entry operation.
mlir::MutableOperandRange getMutableDataOperands(mlir::Operation *accOp)
Used to get a mutable range iterating over the data operands.
mlir::SmallVector< mlir::Value > getBounds(mlir::Operation *accDataClauseOp)
Used to obtain bounds from an acc data clause operation.
OpenACCExecMapping
Enumeration used to encode the execution mapping on a loop construct.
mlir::ValueRange getDataOperands(mlir::Operation *accOp)
Used to get an immutable range iterating over the data operands.
std::optional< llvm::StringRef > getVarName(mlir::Operation *accOp)
Used to obtain the name from an acc operation.
static constexpr StringLiteral getRoutineInfoAttrName()
bool getImplicitFlag(mlir::Operation *accDataEntryOp)
Used to find out whether data operation is implicit.
static constexpr StringLiteral getCombinedConstructsAttrName()
mlir::Value getVarPtrPtr(mlir::Operation *accDataClauseOp)
Used to obtain the varPtrPtr from a data clause operation.
mlir::Value getAccPtr(mlir::Operation *accDataClauseOp)
Used to obtain the accPtr from a data clause operation.
static constexpr StringLiteral getDeclareAttrName()
Used to obtain the attribute name for declare.
static constexpr StringLiteral getDeclareActionAttrName()
Include the generated interface declarations.
mlir::StringRef getName() final
Return a string name of the resource.
mlir::StringRef getName() final
Return a string name of the resource.