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/Decoders.hpp | |
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/Decoders.hpp')
-rw-r--r-- | src/backends/reference/workloads/Decoders.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/backends/reference/workloads/Decoders.hpp b/src/backends/reference/workloads/Decoders.hpp new file mode 100644 index 0000000000..4112e7d454 --- /dev/null +++ b/src/backends/reference/workloads/Decoders.hpp @@ -0,0 +1,48 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include "BaseIterator.hpp" + +namespace armnn +{ + +template<typename T> +std::unique_ptr<Decoder<T>> MakeDecoder(const TensorInfo& info, const void* data); + +template<> +std::unique_ptr<Decoder<float>> MakeDecoder(const TensorInfo& info, const void* data) +{ + switch(info.GetDataType()) + { + case armnn::DataType::QuantisedAsymm8: + { + return std::make_unique<QASymm8Decoder>( + static_cast<const uint8_t*>(data), + info.GetQuantizationScale(), + info.GetQuantizationOffset()); + } + case armnn::DataType::QuantisedSymm16: + { + return std::make_unique<QSymm16Decoder>( + static_cast<const int16_t*>(data), + info.GetQuantizationScale(), + info.GetQuantizationOffset()); + } + case armnn::DataType::Float32: + { + return std::make_unique<FloatDecoder>(static_cast<const float*>(data)); + } + default: + { + BOOST_ASSERT_MSG(false, "Not supported Data Type!"); + break; + } + } + return nullptr; +} + +} //namespace armnn
\ No newline at end of file |