aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/ewise_unary.h
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2022-06-07 05:20:44 +0000
committerEric Kunze <eric.kunze@arm.com>2022-06-15 11:38:04 -0700
commitb5fabec33abeca2d92c20c7b094fa3f113d0ddd8 (patch)
tree9c7d946012c7a70a7fcb237daa4376d7b65c6f76 /reference_model/src/ops/ewise_unary.h
parent24594f55ee3bf0e95c764e51b94c3ec7f9cfa54a (diff)
downloadreference_model-b5fabec33abeca2d92c20c7b094fa3f113d0ddd8.tar.gz
Remove quantization info from serialization attributes
Any needed information moves into the attributes for each operator. New serialization library version removes teh quantization information attributes from the schema Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Icf6165687ab1fd34a01f64c01b0b92b2820e72fa
Diffstat (limited to 'reference_model/src/ops/ewise_unary.h')
-rw-r--r--reference_model/src/ops/ewise_unary.h43
1 files changed, 19 insertions, 24 deletions
diff --git a/reference_model/src/ops/ewise_unary.h b/reference_model/src/ops/ewise_unary.h
index 374c8e4..16a4c88 100644
--- a/reference_model/src/ops/ewise_unary.h
+++ b/reference_model/src/ops/ewise_unary.h
@@ -49,7 +49,7 @@ protected:
class Op##Opname : public UnaryNode<Rank, Dtype> \
{ \
public: \
- Op##Opname(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, TosaQuantInfoBase* qinfo_, uint64_t id_) \
+ Op##Opname(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_) \
: UnaryNode<Rank, Dtype>(sgt_, Op_##OPNAME, id_) \
{ \
register_fcn(); \
@@ -61,27 +61,6 @@ protected:
virtual int register_fcn(); \
};
-#define DEF_TEMPLATE_UNARY_OP_WITH_QUANT_INFO(Opname, OPNAME) \
- template <int Rank, DType Dtype> \
- class Op##Opname : public UnaryNode<Rank, Dtype> \
- { \
- public: \
- Op##Opname(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, TosaQuantInfoBase* qinfo_, uint64_t id_) \
- : UnaryNode<Rank, Dtype>(sgt_, Op_##OPNAME, id_) \
- { \
- INIT_QINFO(Unary); \
- register_fcn(); \
- } \
- static constexpr int32_t QMin = GetQMin<Dtype>::value; \
- static constexpr int32_t QMax = GetQMax<Dtype>::value; \
- using InEigenType = typename GetEigenType<Dtype>::type; \
- using OutEigenType = typename GetEigenType<Dtype>::type; \
- virtual int register_fcn(); \
- \
- protected: \
- TosaUnaryQuantInfo* qinfo; \
- };
-
DEF_TEMPLATE_UNARY_OP(Abs, ABS)
DEF_TEMPLATE_UNARY_OP(BitwiseNot, BITWISE_NOT)
DEF_TEMPLATE_UNARY_OP(Ceil, CEIL)
@@ -90,12 +69,28 @@ DEF_TEMPLATE_UNARY_OP(Exp, EXP)
DEF_TEMPLATE_UNARY_OP(Floor, FLOOR)
DEF_TEMPLATE_UNARY_OP(Log, LOG)
DEF_TEMPLATE_UNARY_OP(LogicalNot, LOGICAL_NOT)
-DEF_TEMPLATE_UNARY_OP_WITH_QUANT_INFO(Negate, NEGATE)
DEF_TEMPLATE_UNARY_OP(Reciprocal, RECIPROCAL)
DEF_TEMPLATE_UNARY_OP(Rsqrt, RSQRT)
#undef DEF_TEMPLATE_UNARY_OP
-#undef DEF_TEMPLATE_UNARY_OP_WITH_QUANT_INFO
+
+// Negate is the only unary op with attributes
+template <int Rank, DType Dtype>
+class OpNegate : public UnaryNode<Rank, Dtype>
+{
+public:
+ OpNegate(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_);
+ virtual ~OpNegate();
+
+ static constexpr int32_t QMin = GetQMin<Dtype>::value;
+ static constexpr int32_t QMax = GetQMax<Dtype>::value;
+ using InEigenType = typename GetEigenType<Dtype>::type;
+ using OutEigenType = typename GetEigenType<Dtype>::type;
+ virtual int register_fcn();
+
+protected:
+ tosa::TosaNegateAttribute* attribute;
+};
}; // namespace TosaReference