aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/ewise_unary.cc
diff options
context:
space:
mode:
authorJerry Ge <jerry.ge@arm.com>2023-07-19 23:08:16 +0000
committerJerry Ge <jerry.ge@arm.com>2023-07-25 22:49:17 +0000
commit9c9c8dafe8f9a32bd70aee268cd537b93865a3ba (patch)
treee94fc471261b9f72bef86033fbc76022f55d5de8 /reference_model/src/ops/ewise_unary.cc
parentc1e13432b4a218781afd6b0171d4afff11730433 (diff)
downloadreference_model-9c9c8dafe8f9a32bd70aee268cd537b93865a3ba.tar.gz
Run clang-format and update copyright
- Also added run clang-format to pre-commit runs Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I4e59ac0afbaa30dce0773aa63d92a1a3b119e2f3
Diffstat (limited to 'reference_model/src/ops/ewise_unary.cc')
-rw-r--r--reference_model/src/ops/ewise_unary.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/reference_model/src/ops/ewise_unary.cc b/reference_model/src/ops/ewise_unary.cc
index e6e870e..05c1f4b 100644
--- a/reference_model/src/ops/ewise_unary.cc
+++ b/reference_model/src/ops/ewise_unary.cc
@@ -237,9 +237,7 @@ int OpLogicalNot<Rank, Dtype>::register_fcn()
}
template <int Rank, TOSA_REF_TYPE Dtype>
-OpNegate<Rank, Dtype>::OpNegate(SubgraphTraverser* sgt_,
- TosaAttributeBase* attribute_,
- uint64_t id_)
+OpNegate<Rank, Dtype>::OpNegate(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_)
: UnaryNode<Rank, Dtype>(sgt_, Op_NEGATE, id_)
{
INIT_ATTRIBUTE(Negate);
@@ -279,10 +277,11 @@ int OpNegate<Rank, Dtype>::register_fcn()
case TOSA_REF_TYPE_INT16:
case TOSA_REF_TYPE_INT32:
this->fcn = [this](InEigenType a) -> OutEigenType {
- int64_t res_in_64 = 0L - a;
+ int64_t res_in_64 = 0L - a;
int64_t i32_max_in_64 = static_cast<int64_t>(std::numeric_limits<int32_t>::max());
int64_t i32_min_in_64 = static_cast<int64_t>(std::numeric_limits<int32_t>::min());
- REQUIRE(res_in_64 <= i32_max_in_64 && res_in_64 >= i32_min_in_64, "OpNegate: result not in acc type range (int32)");
+ REQUIRE(res_in_64 <= i32_max_in_64 && res_in_64 >= i32_min_in_64,
+ "OpNegate: result not in acc type range (int32)");
int64_t max_clip_in_64, min_clip_in_64;
if (Dtype == TOSA_REF_TYPE_INT16)
@@ -295,17 +294,20 @@ int OpNegate<Rank, Dtype>::register_fcn()
max_clip_in_64 = i32_max_in_64;
min_clip_in_64 = i32_min_in_64;
}
- return static_cast<InEigenType>(std::min<int64_t>(max_clip_in_64, std::max<int64_t>(min_clip_in_64, res_in_64)));
+ return static_cast<InEigenType>(
+ std::min<int64_t>(max_clip_in_64, std::max<int64_t>(min_clip_in_64, res_in_64)));
};
break;
case TOSA_REF_TYPE_INT8:
this->fcn = [this](InEigenType a) -> OutEigenType {
- int64_t res_in_64 = 0 - (a - attribute->input1_zp());
+ int64_t res_in_64 = 0 - (a - attribute->input1_zp());
int64_t i32_max_in_64 = static_cast<int64_t>(std::numeric_limits<int32_t>::max());
int64_t i32_min_in_64 = static_cast<int64_t>(std::numeric_limits<int32_t>::min());
- REQUIRE(res_in_64 <= i32_max_in_64 && res_in_64 >= i32_min_in_64, "OpNegate: result not in acc type range (int32)");
+ REQUIRE(res_in_64 <= i32_max_in_64 && res_in_64 >= i32_min_in_64,
+ "OpNegate: result not in acc type range (int32)");
res_in_64 += attribute->output_zp();
- InEigenType result = static_cast<InEigenType>(std::min(std::max(res_in_64, static_cast<int64_t>(QMin)), static_cast<int64_t>(QMax)));
+ InEigenType result = static_cast<InEigenType>(
+ std::min(std::max(res_in_64, static_cast<int64_t>(QMin)), static_cast<int64_t>(QMax)));
return result;
};
break;