From 4d1ff588288b1a7a98dd2fd7f2ba5717b8ecf102 Mon Sep 17 00:00:00 2001 From: James Conroy Date: Mon, 10 Jun 2019 17:06:39 +0100 Subject: IVGCVSW-3221 Refactor Mean ref workload and tests * Renamed RefMeanFloat32Workload and RefMeanUint8Workload to RefMeanWorkload, updated references to reflect this change. * Refactored RefFloorWorkload to use Decoders/Encoders, to support the use of multiple data types. * Deleted reference Unit8 Mean tests as they were duplicates of the Float32 tests. Refactored these tests to support multiple data types and updated references. * Adjusted the values used in the tests' input tensors so that they are more like floating point numbers e.g. change 1.0f to 1.5f. * Replace size_t with unsigned int in Mean ref workload, for better compatibility with the Encoder/Decoder, removed some unnecessary casts after this. * Added ValidateTensorDataTypesMatch() function to WorkloadData.cpp, added CreateIncorrectDimensionsErrorMsg function to RefLayerSupport.cpp. * Added passing and failing tests for ref IsMeanSupported. Signed-off-by: James Conroy Change-Id: Id3d44463d1385255c727a497d4026d21a49e7eb2 --- .../reference/workloads/RefMeanUint8Workload.cpp | 39 ---------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/backends/reference/workloads/RefMeanUint8Workload.cpp (limited to 'src/backends/reference/workloads/RefMeanUint8Workload.cpp') diff --git a/src/backends/reference/workloads/RefMeanUint8Workload.cpp b/src/backends/reference/workloads/RefMeanUint8Workload.cpp deleted file mode 100644 index 4ebffcfd70..0000000000 --- a/src/backends/reference/workloads/RefMeanUint8Workload.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#include "RefMeanUint8Workload.hpp" - -#include "Mean.hpp" -#include "RefWorkloadUtils.hpp" - -#include "Profiling.hpp" - -#include - -namespace armnn -{ - -RefMeanUint8Workload::RefMeanUint8Workload(const MeanQueueDescriptor& descriptor, const WorkloadInfo& info) - :Uint8Workload(descriptor, info) {} - - -void RefMeanUint8Workload::Execute() const -{ - ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefMeanUint8Workload_Execute"); - - const TensorInfo& inputInfo = GetTensorInfo(m_Data.m_Inputs[0]); - const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]); - - auto dequant = Dequantize(GetInputTensorDataU8(0, m_Data), inputInfo); - - std::vector results(outputInfo.GetNumElements()); - - Mean(inputInfo, outputInfo, m_Data.m_Parameters.m_Axis, dequant.data(), results.data()); - - Quantize(GetOutputTensorDataU8(0, m_Data), results.data(), outputInfo); -} - -} //namespace armnn - -- cgit v1.2.1