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/OpenACCOpsInterfaces.h.inc"
26 #include "mlir/Dialect/OpenACC/OpenACCTypeInterfaces.h.inc"
32 #define GET_TYPEDEF_CLASSES
33 #include "mlir/Dialect/OpenACC/OpenACCOpsTypes.h.inc"
35 #define GET_ATTRDEF_CLASSES
36 #include "mlir/Dialect/OpenACC/OpenACCOpsAttributes.h.inc"
40 #define GET_OP_CLASSES
41 #include "mlir/Dialect/OpenACC/OpenACCOps.h.inc"
43 #define ACC_DATA_ENTRY_OPS \
44 mlir::acc::CopyinOp, mlir::acc::CreateOp, mlir::acc::PresentOp, \
45 mlir::acc::NoCreateOp, mlir::acc::AttachOp, mlir::acc::DevicePtrOp, \
46 mlir::acc::GetDevicePtrOp, mlir::acc::PrivateOp, \
47 mlir::acc::FirstprivateOp, mlir::acc::UpdateDeviceOp, \
48 mlir::acc::UseDeviceOp, mlir::acc::ReductionOp, \
49 mlir::acc::DeclareDeviceResidentOp, mlir::acc::DeclareLinkOp, \
51 #define ACC_DATA_EXIT_OPS \
52 mlir::acc::CopyoutOp, mlir::acc::DeleteOp, mlir::acc::DetachOp, \
53 mlir::acc::UpdateHostOp
54 #define ACC_DATA_CLAUSE_OPS ACC_DATA_ENTRY_OPS, ACC_DATA_EXIT_OPS
55 #define ACC_COMPUTE_CONSTRUCT_OPS \
56 mlir::acc::ParallelOp, mlir::acc::KernelsOp, mlir::acc::SerialOp
57 #define ACC_COMPUTE_CONSTRUCT_AND_LOOP_OPS \
58 ACC_COMPUTE_CONSTRUCT_OPS, mlir::acc::LoopOp
59 #define ACC_DATA_CONSTRUCT_STRUCTURED_OPS \
60 mlir::acc::DataOp, mlir::acc::DeclareOp
61 #define ACC_DATA_CONSTRUCT_UNSTRUCTURED_OPS \
62 mlir::acc::EnterDataOp, mlir::acc::ExitDataOp, mlir::acc::UpdateOp, \
63 mlir::acc::HostDataOp, mlir::acc::DeclareEnterOp, \
64 mlir::acc::DeclareExitOp
65 #define ACC_DATA_CONSTRUCT_OPS \
66 ACC_DATA_CONSTRUCT_STRUCTURED_OPS, ACC_DATA_CONSTRUCT_UNSTRUCTURED_OPS
67 #define ACC_COMPUTE_AND_DATA_CONSTRUCT_OPS \
68 ACC_COMPUTE_CONSTRUCT_OPS, ACC_DATA_CONSTRUCT_OPS
69 #define ACC_COMPUTE_LOOP_AND_DATA_CONSTRUCT_OPS \
70 ACC_COMPUTE_CONSTRUCT_AND_LOOP_OPS, ACC_DATA_CONSTRUCT_OPS
125 std::optional<mlir::acc::DataClause>
141 return StringLiteral(
"acc.declare");
145 return StringLiteral(
"acc.declare_action");
149 return StringLiteral(
"acc.routine_info");
153 return CombinedConstructsTypeAttr::name;
158 mlir::StringRef
getName() final {
return "AccRuntimeCounters"; }
163 mlir::StringRef
getName() final {
return "AccConstructResource"; }
168 mlir::StringRef
getName() final {
return "AccCurrentDeviceIdResource"; }
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.
mlir::SmallVector< mlir::Value > getAsyncOperands(mlir::Operation *accDataClauseOp)
Used to obtain async operands from an acc data clause operation.
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.
mlir::ArrayAttr getAsyncOnly(mlir::Operation *accDataClauseOp)
Returns an array of acc:DeviceTypeAttr attributes attached to an acc data clause operation,...
static constexpr StringLiteral getDeclareAttrName()
Used to obtain the attribute name for declare.
static constexpr StringLiteral getDeclareActionAttrName()
mlir::ArrayAttr getAsyncOperandsDeviceType(mlir::Operation *accDataClauseOp)
Returns an array of acc:DeviceTypeAttr attributes attached to an acc data clause operation,...
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.
mlir::StringRef getName() final
Return a string name of the resource.