@@ -180,6 +180,36 @@ def OpenACC_MappableTypeInterface : TypeInterface<"MappableType"> {
180
180
return ::mlir::acc::VariableTypeCategory::uncategorized;
181
181
}]
182
182
>,
183
+ InterfaceMethod<
184
+ /*description=*/[{
185
+ Generates the operations that would be normally placed in a recipe's
186
+ init region. It inserts at the builder's current location.
187
+ It can be used either to directly "inline" the init region
188
+ or if the caller sets the insertion point to inside a recipe body,
189
+ it fills it in. This does not generate the `acc.yield` that normally
190
+ would terminate a recipe.
191
+
192
+ The `extents` are optional and can be empty - it is only when a
193
+ slice of the private variable needs allocation.
194
+ The `initVal` can be empty - it is primarily needed for reductions
195
+ to ensure the variable is also initialized with appropriate value.
196
+
197
+ If the return value is empty, it means that recipe body was not
198
+ successfully generated.
199
+ }],
200
+ /*retTy=*/"::mlir::Value",
201
+ /*methodName=*/"generatePrivateInit",
202
+ /*args=*/(ins "::mlir::OpBuilder &":$builder,
203
+ "::mlir::Location":$loc,
204
+ "::mlir::TypedValue<::mlir::acc::MappableType>":$var,
205
+ "::llvm::StringRef":$varName,
206
+ "::mlir::ValueRange":$extents,
207
+ "::mlir::Value":$initVal),
208
+ /*methodBody=*/"",
209
+ /*defaultImplementation=*/[{
210
+ return {};
211
+ }]
212
+ >,
183
213
];
184
214
}
185
215
0 commit comments