MLIR  19.0.0git
Go to the documentation of this file.
1 //===- ParallelCombiningOpInterface.cpp - Parallel combining op interface -===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
11 using namespace mlir;
13 //===----------------------------------------------------------------------===//
14 // ParallelCombiningOpInterface
15 //===----------------------------------------------------------------------===//
17 // TODO: Single region single block interface on interfaces ?
19  if (op->getNumRegions() != 1)
20  return op->emitError("expected single region op");
21  if (!op->getRegion(0).hasOneBlock())
22  return op->emitError("expected single block op region");
23  return success();
24 }
26 /// Include the definitions of the interface.
27 #include "mlir/Interfaces/"
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:88
unsigned getNumRegions()
Returns the number of regions held by this operation.
Definition: Operation.h:669
InFlightDiagnostic emitError(const Twine &message={})
Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers tha...
Definition: Operation.cpp:268
Region & getRegion(unsigned index)
Returns the region held by this operation at position 'index'.
Definition: Operation.h:682
bool hasOneBlock()
Return true if this region has exactly one block.
Definition: Region.h:68
LogicalResult verifyParallelCombiningOpInterface(Operation *op)
Include the generated interface declarations.
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
Definition: LogicalResult.h:56
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26