diff options
author | Derek Lamberti <derek.lamberti@arm.com> | 2019-04-09 10:25:02 +0100 |
---|---|---|
committer | Derek Lamberti <derek.lamberti@arm.com> | 2019-04-10 15:13:41 +0100 |
commit | f30f7d32b22020f80b21da7b008d8302cee9d395 (patch) | |
tree | 2e213da4704c46b40f20629223365d1ddbf8d8cd /src/backends/reference/workloads/ElementwiseFunction.cpp | |
parent | 82fbe7c0b82f7adadd5120ac4b4f779d0da7c0d5 (diff) | |
download | armnn-f30f7d32b22020f80b21da7b008d8302cee9d395.tar.gz |
IVGCVSW-2946 RefElementwiseWorkload configures prior to first execute
+ Added PostAllocationConfigure() method to workload interface
+ Elementwise function now deduces types based on Functor
- Replaced RefComparisonWorkload with RefElementwiseWorkload specialization
+ Fixed up unit tests and minor formatting
Change-Id: I33d08797767bba01cf4efb2904920ce0f950a4fe
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'src/backends/reference/workloads/ElementwiseFunction.cpp')
-rw-r--r-- | src/backends/reference/workloads/ElementwiseFunction.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/backends/reference/workloads/ElementwiseFunction.cpp b/src/backends/reference/workloads/ElementwiseFunction.cpp index 934a86217a..7a5c071f70 100644 --- a/src/backends/reference/workloads/ElementwiseFunction.cpp +++ b/src/backends/reference/workloads/ElementwiseFunction.cpp @@ -13,26 +13,25 @@ namespace armnn { -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) +template <typename Functor> +ElementwiseFunction<Functor>::ElementwiseFunction(const TensorShape& inShape0, + const TensorShape& inShape1, + const TensorShape& outShape, + armnn::Decoder<InType>& inData0, + armnn::Decoder<InType>& inData1, + armnn::Encoder<OutType>& outData) { BroadcastLoop(inShape0, inShape1, outShape).Unroll(Functor(), 0, inData0, inData1, outData); } } //namespace armnn -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>; +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>>; |