Skip to content

Commit e9db990

Browse files
author
Razvan Lupusoru
committed
Do not require recipe for MappableType
1 parent 14efac9 commit e9db990

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,13 @@ checkValidModifier(Op op, acc::DataClauseModifier validModifiers) {
492492

493493
template <typename OpT, typename RecipeOpT>
494494
static LogicalResult checkRecipe(OpT op, llvm::StringRef operandName) {
495+
// Mappable types do not need a recipe because it is possible to generate one
496+
// from its API. Reject reductions though because no API is available for them
497+
// at this time.
498+
if (mlir::acc::isMappableType(op.getVar().getType()) &&
499+
!std::is_same_v<OpT, acc::ReductionOp>)
500+
return success();
501+
495502
mlir::SymbolRefAttr operandRecipe = op.getRecipeAttr();
496503
if (!operandRecipe)
497504
return op->emitOpError() << "recipe expected for " << operandName;

0 commit comments

Comments
 (0)