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/ArithmeticFunction.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/ArithmeticFunction.cpp')
-rw-r--r-- | src/armnn/backends/RefWorkloads/ArithmeticFunction.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/armnn/backends/RefWorkloads/ArithmeticFunction.cpp b/src/armnn/backends/RefWorkloads/ArithmeticFunction.cpp new file mode 100644 index 0000000000..fede138253 --- /dev/null +++ b/src/armnn/backends/RefWorkloads/ArithmeticFunction.cpp @@ -0,0 +1,29 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "ArithmeticFunction.hpp" +#include "Broadcast.hpp" +#include <functional> + +namespace armnn +{ + +template <typename Functor> +ArithmeticFunction<Functor>::ArithmeticFunction(const TensorShape& inShape0, + const TensorShape& inShape1, + const TensorShape& outShape, + const float* inData0, + const float* inData1, + float* outData) +{ + BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData); +} + +} //namespace armnn + +template struct armnn::ArithmeticFunction<std::plus<float>>; +template struct armnn::ArithmeticFunction<std::minus<float>>; +template struct armnn::ArithmeticFunction<std::multiplies<float>>; +template struct armnn::ArithmeticFunction<std::divides<float>>; |