diff options
author | James Conroy <james.conroy@arm.com> | 2019-05-30 16:36:59 +0100 |
---|---|---|
committer | James Conroy <james.conroy@arm.com> | 2019-05-31 15:56:38 +0100 |
commit | 83735b177a4c71952d36e7a7919537b5a4d6d49e (patch) | |
tree | 51a2e30b1f6caeea9994848c3be6f93471d03b64 /src/backends/backendsCommon/test/FloorTestImpl.hpp | |
parent | 983daec95bd3b3e5558771e995092981f2df2373 (diff) | |
download | armnn-83735b177a4c71952d36e7a7919537b5a4d6d49e.tar.gz |
IVGCVSW-3177 Refactor Floor reference workload
* Renamed RefFloorFloat32Workload to RefFloorWorkload
and updated references to reflect this change.
* RefFloorWorkload now uses Decoders/Encoders and
supports the use of multiple data types.
* Deleted FloorTestImpl.hpp and moved its contents
into LayerTests.hpp.
Change-Id: Ie079d05f2f6a578172f0fe3024f9607c030bce64
Signed-off-by: James Conroy <james.conroy@arm.com>
Diffstat (limited to 'src/backends/backendsCommon/test/FloorTestImpl.hpp')
-rw-r--r-- | src/backends/backendsCommon/test/FloorTestImpl.hpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/backends/backendsCommon/test/FloorTestImpl.hpp b/src/backends/backendsCommon/test/FloorTestImpl.hpp deleted file mode 100644 index 419b1b7bd8..0000000000 --- a/src/backends/backendsCommon/test/FloorTestImpl.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// -#pragma once - -#include "QuantizeHelper.hpp" -#include "WorkloadTestUtils.hpp" - -#include <armnn/ArmNN.hpp> -#include <armnn/Tensor.hpp> -#include <armnn/TypesUtils.hpp> - -#include <backendsCommon/CpuTensorHandle.hpp> -#include <backendsCommon/IBackendInternal.hpp> -#include <backendsCommon/WorkloadFactory.hpp> - -#include <test/TensorHelpers.hpp> - -LayerTestResult<float, 4> SimpleFloorTest( - armnn::IWorkloadFactory& workloadFactory, - const armnn::IBackendInternal::IMemoryManagerSharedPtr& memoryManager) -{ - const armnn::TensorInfo inputTensorInfo({1, 3, 2, 3}, armnn::DataType::Float32); - const armnn::TensorInfo outputTensorInfo(inputTensorInfo); - - auto input = MakeTensor<float, 4>(inputTensorInfo, - { -37.5f, -15.2f, -8.76f, -2.0f, -1.5f, -1.3f, -0.5f, -0.4f, 0.0f, - 1.0f, 0.4f, 0.5f, 1.3f, 1.5f, 2.0f, 8.76f, 15.2f, 37.5f }); - - LayerTestResult<float, 4> ret(outputTensorInfo); - ret.outputExpected = MakeTensor<float, 4>(outputTensorInfo, - { -38.0f, -16.0f, -9.0f, -2.0f, -2.0f, -2.0f, -1.0f, -1.0f, 0.0f, - 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 2.0f, 8.0f, 15.0f, 37.0f }); - - std::unique_ptr<armnn::ITensorHandle> inputHandle = workloadFactory.CreateTensorHandle(inputTensorInfo); - std::unique_ptr<armnn::ITensorHandle> outputHandle = workloadFactory.CreateTensorHandle(outputTensorInfo); - - armnn::FloorQueueDescriptor data; - armnn::WorkloadInfo info; - AddInputToWorkload(data, info, inputTensorInfo, inputHandle.get()); - AddOutputToWorkload(data, info, outputTensorInfo, outputHandle.get()); - - std::unique_ptr<armnn::IWorkload> workload = workloadFactory.CreateFloor(data, info); - - inputHandle->Allocate(); - outputHandle->Allocate(); - - CopyDataToITensorHandle(inputHandle.get(), &input[0][0][0][0]); - - workload->Execute(); - - CopyDataFromITensorHandle(&ret.output[0][0][0][0], outputHandle.get()); - - return ret; -} |