MLIR  20.0.0git
ParallelCombiningOpInterface.cpp
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 https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 using namespace mlir;
12 
13 //===----------------------------------------------------------------------===//
14 // ParallelCombiningOpInterface
15 //===----------------------------------------------------------------------===//
16 
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 }
25 
26 /// Include the definitions of the interface.
27 #include "mlir/Interfaces/ParallelCombiningOpInterface.cpp.inc"
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.