diff options
author | kevmay01 <kevin.may@arm.com> | 2019-01-24 14:05:09 +0000 |
---|---|---|
committer | kevmay01 <kevin.may@arm.com> | 2019-01-24 14:05:09 +0000 |
commit | 2b4d88e34ac1f965417fd236fd4786f26bae2042 (patch) | |
tree | 4518b52c6a22e33c4b467588a2843c9d5f1a9ee6 /src/backends/reference/workloads/ElementwiseFunction.cpp | |
parent | 94412aff782472be54dce4328e2ecee0225b3e97 (diff) | |
download | armnn-2b4d88e34ac1f965417fd236fd4786f26bae2042.tar.gz |
IVGCVSW-2503 Refactor RefElementwiseWorkload around Equal and Greater
* Remove Equal and Greater from RefElementwiseWorkload
* Create RefComparisonWorkload and add Equal and Greater
* Update ElementwiseFunction for different input/output types
* Update TfParser to create Equal/Greater with Boolean output
* Update relevant tests to check for Boolean comparison
Change-Id: I299b7f2121769c960ac0c6139764a5f3c89c9c32
Diffstat (limited to 'src/backends/reference/workloads/ElementwiseFunction.cpp')
-rw-r--r-- | src/backends/reference/workloads/ElementwiseFunction.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/backends/reference/workloads/ElementwiseFunction.cpp b/src/backends/reference/workloads/ElementwiseFunction.cpp index cb8aa7089c..c8c25ef9e9 100644 --- a/src/backends/reference/workloads/ElementwiseFunction.cpp +++ b/src/backends/reference/workloads/ElementwiseFunction.cpp @@ -13,24 +13,26 @@ namespace armnn { -template <typename Functor> -ElementwiseFunction<Functor>::ElementwiseFunction(const TensorShape& inShape0, - const TensorShape& inShape1, - const TensorShape& outShape, - const float* inData0, - const float* inData1, - float* outData) +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) { BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData); } } //namespace armnn -template struct armnn::ElementwiseFunction<std::plus<float>>; -template struct armnn::ElementwiseFunction<std::minus<float>>; -template struct armnn::ElementwiseFunction<std::multiplies<float>>; -template struct armnn::ElementwiseFunction<std::divides<float>>; -template struct armnn::ElementwiseFunction<armnn::maximum<float>>; -template struct armnn::ElementwiseFunction<armnn::minimum<float>>; -template struct armnn::ElementwiseFunction<std::equal_to<float>>; -template struct armnn::ElementwiseFunction<std::greater<float>>; +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>; |