forked from onnx/onnx-mlir
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ZHighOps.hpp
60 lines (48 loc) · 1.7 KB
/
ZHighOps.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* SPDX-License-Identifier: Apache-2.0
*/
//===------------------ ZHighOps.hpp - ZHigh Operations -------------------===//
//
// Copyright 2019-2022 The IBM Research Authors.
//
// =============================================================================
//
// This file defines the ZHigh operations in the MLIR operation set.
//
//===----------------------------------------------------------------------===//
#pragma once
#include <map>
#include <string>
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpDefinition.h"
#include "src/Dialect/ONNX/ONNXOps/ShapeHelper.hpp"
#include "src/Interface/ShapeInferenceOpInterface.hpp"
namespace mlir {
//===----------------------------------------------------------------------===//
// Traits
namespace OpTrait {
namespace impl {
LogicalResult verifySameOperandsAndResultLayout(Operation *op);
}
/// This class provides verification for ops that are known to have the same
/// operand and result layout.
template <typename ConcreteType>
class SameOperandsAndResultLayout
: public TraitBase<ConcreteType, SameOperandsAndResultLayout> {
public:
static LogicalResult verifyTrait(Operation *op) {
return impl::verifySameOperandsAndResultLayout(op);
}
};
} // namespace OpTrait
} // namespace mlir
/// Include the auto-generated header files containing the declarations of the
/// ZHigh dialect and operations.
#include "src/Accelerators/NNPA/Dialect/ZHigh/ZHighDialect.hpp.inc"
#define GET_ATTRDEF_CLASSES
#include "src/Accelerators/NNPA/Dialect/ZHigh/ZHighAttributes.hpp.inc"
#define GET_OP_CLASSES
#include "src/Accelerators/NNPA/Dialect/ZHigh/ZHighOps.hpp.inc"