xref: /llvm-project/mlir/lib/Interfaces/ParallelCombiningOpInterface.cpp (revision b994d388aeb26aa54611e53884447b21dd3b440b)
1*b994d388SNicolas Vasilache //===- ParallelCombiningOpInterface.cpp - Parallel combining op interface -===//
2*b994d388SNicolas Vasilache //
3*b994d388SNicolas Vasilache // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*b994d388SNicolas Vasilache // See https://llvm.org/LICENSE.txt for license information.
5*b994d388SNicolas Vasilache // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*b994d388SNicolas Vasilache //
7*b994d388SNicolas Vasilache //===----------------------------------------------------------------------===//
8*b994d388SNicolas Vasilache 
9*b994d388SNicolas Vasilache #include "mlir/Interfaces/ParallelCombiningOpInterface.h"
10*b994d388SNicolas Vasilache 
11*b994d388SNicolas Vasilache using namespace mlir;
12*b994d388SNicolas Vasilache 
13*b994d388SNicolas Vasilache //===----------------------------------------------------------------------===//
14*b994d388SNicolas Vasilache // ParallelCombiningOpInterface
15*b994d388SNicolas Vasilache //===----------------------------------------------------------------------===//
16*b994d388SNicolas Vasilache 
17*b994d388SNicolas Vasilache // TODO: Single region single block interface on interfaces ?
verifyParallelCombiningOpInterface(Operation * op)18*b994d388SNicolas Vasilache LogicalResult mlir::detail::verifyParallelCombiningOpInterface(Operation *op) {
19*b994d388SNicolas Vasilache   if (op->getNumRegions() != 1)
20*b994d388SNicolas Vasilache     return op->emitError("expected single region op");
21*b994d388SNicolas Vasilache   if (!op->getRegion(0).hasOneBlock())
22*b994d388SNicolas Vasilache     return op->emitError("expected single block op region");
23*b994d388SNicolas Vasilache   return success();
24*b994d388SNicolas Vasilache }
25*b994d388SNicolas Vasilache 
26*b994d388SNicolas Vasilache /// Include the definitions of the interface.
27*b994d388SNicolas Vasilache #include "mlir/Interfaces/ParallelCombiningOpInterface.cpp.inc"
28