diff options
author | David Beck <david.beck@arm.com> | 2018-09-11 16:37:14 +0100 |
---|---|---|
committer | Matthew Bentham <matthew.bentham@arm.com> | 2018-10-01 14:56:47 +0100 |
commit | 591cdb7ad9176d43163b340542b0fff470a198ea (patch) | |
tree | 67b3a910f85a4ae3850fea34c893525c100feae1 /src/armnn/backends/RefWorkloads/Division.cpp | |
parent | 549ae37b51facbdf940bff62b45b3b74c1bc63c9 (diff) | |
download | armnn-591cdb7ad9176d43163b340542b0fff470a198ea.tar.gz |
IVGCVSW-1843 : replacing trivial arithmetic helpers
Change-Id: Iddf637694f1a3a7ef00f006a41b8044a35c7e73c
Diffstat (limited to 'src/armnn/backends/RefWorkloads/Division.cpp')
-rw-r--r-- | src/armnn/backends/RefWorkloads/Division.cpp | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/src/armnn/backends/RefWorkloads/Division.cpp b/src/armnn/backends/RefWorkloads/Division.cpp deleted file mode 100644 index cc7f7c9fe4..0000000000 --- a/src/armnn/backends/RefWorkloads/Division.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#include "Division.hpp" -#include "Broadcast.hpp" - -#include <functional> - -#include <cmath> - -namespace -{ - -void ElementwiseDivision(unsigned int numElements, - const float* inData0, - const float* inData1, - float* outData) -{ - for (unsigned int i = 0; i < numElements; ++i) - { - if (inData1[i] != 0.0f) - { - outData[i] = inData0[i] / inData1[i]; - } - else if (inData0[i] == 0.0f) - { - if (!std::signbit(inData1[i])) - { - outData[i]= NAN; - } - else - { - outData[i]= -NAN; - } - } - else if (inData0[i] < 0.0f) - { - if (!std::signbit(inData1[i])) - { - outData[i] = -INFINITY; - } - else - { - outData[i] = INFINITY; - } - } - else - { - if (!std::signbit(inData1[i])) - { - outData[i] = INFINITY; - } - else - { - outData[i] = -INFINITY; - } - } - } -} - -} // namespace - -namespace armnn -{ - -void Division(const TensorShape& inShape0, - const TensorShape& inShape1, - const TensorShape& outShape, - const float* inData0, - const float* inData1, - float* outData) -{ - if (inShape0 == inShape1) - { - ElementwiseDivision(inShape0.GetNumElements(), inData0, inData1, outData); - } - else - { - BroadcastLoop(inShape0, inShape1, outShape).Unroll(std::divides<float>(), - 0, - inData0, - inData1, - outData); - } -} - -} //namespace armnn |