brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1010 B · 5eda355 Raw
27 lines · cpp
1//===- ShapedOpInterfaces.cpp - Interfaces for Shaped Ops -----------------===//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-exception6//7//===----------------------------------------------------------------------===//8 9#include "mlir/Interfaces/ShapedOpInterfaces.h"10 11using namespace mlir;12 13//===----------------------------------------------------------------------===//14// ShapedDimOpInterface15//===----------------------------------------------------------------------===//16 17LogicalResult mlir::detail::verifyShapedDimOpInterface(Operation *op) {18  if (op->getNumResults() != 1)19    return op->emitError("expected single op result");20  if (!op->getResult(0).getType().isIndex())21    return op->emitError("expect index result type");22  return success();23}24 25/// Include the definitions of the interface.26#include "mlir/Interfaces/ShapedOpInterfaces.cpp.inc"27