aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/ElementwiseFunction.cpp
diff options
context:
space:
mode:
authorSadik Armagan <sadik.armagan@arm.com>2019-04-03 17:48:18 +0100
committerSadik Armagan <sadik.armagan@arm.com>2019-04-08 15:48:28 +0000
commit2e6dc3a1c5d47825535db7993ba77eb1596ae99b (patch)
tree48e73fa1862d17534804d1699bedb76120e88c9f /src/backends/reference/workloads/ElementwiseFunction.cpp
parent0324f48e64edb99a5c8d819394545d97e0c2ae97 (diff)
downloadarmnn-2e6dc3a1c5d47825535db7993ba77eb1596ae99b.tar.gz
IVGCVSW-2861 Refactor the Reference Elementwise workload
* Refactor Reference Comparison workload * Removed templating based on the DataType * Implemented BaseIterator to do decode/encode Change-Id: I18f299f47ee23772f90152c1146b42f07465e105 Signed-off-by: Sadik Armagan <sadik.armagan@arm.com> Signed-off-by: Kevin May <kevin.may@arm.com>
Diffstat (limited to 'src/backends/reference/workloads/ElementwiseFunction.cpp')
-rw-r--r--src/backends/reference/workloads/ElementwiseFunction.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/backends/reference/workloads/ElementwiseFunction.cpp b/src/backends/reference/workloads/ElementwiseFunction.cpp
index c8c25ef9e9..934a86217a 100644
--- a/src/backends/reference/workloads/ElementwiseFunction.cpp
+++ b/src/backends/reference/workloads/ElementwiseFunction.cpp
@@ -13,26 +13,26 @@
namespace armnn
{
-template <typename Functor, typename dataTypeInput, typename dataTypeOutput>
-ElementwiseFunction<Functor, dataTypeInput, dataTypeOutput>::ElementwiseFunction(const TensorShape& inShape0,
- const TensorShape& inShape1,
- const TensorShape& outShape,
- const dataTypeInput* inData0,
- const dataTypeInput* inData1,
- dataTypeOutput* outData)
+template <typename Functor, typename DecoderOp, typename EncoderOp>
+ElementwiseFunction<Functor, DecoderOp, EncoderOp>::ElementwiseFunction(const TensorShape& inShape0,
+ const TensorShape& inShape1,
+ const TensorShape& outShape,
+ DecoderOp& inData0,
+ DecoderOp& inData1,
+ EncoderOp& outData)
{
BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData);
}
} //namespace armnn
-template struct armnn::ElementwiseFunction<std::plus<float>, float, float>;
-template struct armnn::ElementwiseFunction<std::minus<float>, float, float>;
-template struct armnn::ElementwiseFunction<std::multiplies<float>, float, float>;
-template struct armnn::ElementwiseFunction<std::divides<float>, float, float>;
-template struct armnn::ElementwiseFunction<armnn::maximum<float>, float, float>;
-template struct armnn::ElementwiseFunction<armnn::minimum<float>, float, float>;
-template struct armnn::ElementwiseFunction<std::equal_to<float>, float ,uint8_t>;
-template struct armnn::ElementwiseFunction<std::equal_to<uint8_t>, uint8_t, uint8_t>;
-template struct armnn::ElementwiseFunction<std::greater<float>, float, uint8_t>;
-template struct armnn::ElementwiseFunction<std::greater<uint8_t>, uint8_t, uint8_t>;
+template struct armnn::ElementwiseFunction<std::plus<float>, armnn::Decoder, armnn::Encoder>;
+template struct armnn::ElementwiseFunction<std::minus<float>, armnn::Decoder, armnn::Encoder>;
+template struct armnn::ElementwiseFunction<std::multiplies<float>, armnn::Decoder, armnn::Encoder>;
+template struct armnn::ElementwiseFunction<std::divides<float>, armnn::Decoder, armnn::Encoder>;
+template struct armnn::ElementwiseFunction<armnn::maximum<float>, armnn::Decoder, armnn::Encoder>;
+template struct armnn::ElementwiseFunction<armnn::minimum<float>, armnn::Decoder, armnn::Encoder>;
+
+template struct armnn::ElementwiseFunction<std::equal_to<float>, armnn::Decoder, armnn::ComparisonEncoder>;
+template struct armnn::ElementwiseFunction<std::greater<float>, armnn::Decoder, armnn::ComparisonEncoder>;
+