diff options
author | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-09-30 16:34:31 +0100 |
---|---|---|
committer | Kevin May <kevin.may@arm.com> | 2019-10-01 06:50:31 +0000 |
commit | 99836d3537ed5b730be64df3f4cafa63687fb08e (patch) | |
tree | 76661ef6b992751f57390e2ba700aea5567b0995 /src/backends | |
parent | b280196ef4e04725a46155732ff0a1faf6b76722 (diff) | |
download | armnn-99836d3537ed5b730be64df3f4cafa63687fb08e.tar.gz |
IVGCVSW-3734 Enable FLoat16 unit tests for DepthToSpace on NEON
* Added Float16 support to NeonTensorHandle::CopyInFrom() and
NeonTensorHandle::CopyOutTo()
* Added Float16 unit tests for DepthToSpace to NeonLayerTests.cpp
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
Change-Id: Iffbcea699194ea56d5bd43d5e10b0303f07b0933
Diffstat (limited to 'src/backends')
-rw-r--r-- | src/backends/neon/NeonTensorHandle.hpp | 12 | ||||
-rw-r--r-- | src/backends/neon/test/NeonLayerTests.cpp | 10 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/backends/neon/NeonTensorHandle.hpp b/src/backends/neon/NeonTensorHandle.hpp index c3662c1211..37013eb92d 100644 --- a/src/backends/neon/NeonTensorHandle.hpp +++ b/src/backends/neon/NeonTensorHandle.hpp @@ -4,6 +4,8 @@ // #pragma once +#include <Half.hpp> + #include <backendsCommon/OutputHandler.hpp> #include <aclCommon/ArmComputeTensorHandle.hpp> #include <aclCommon/ArmComputeTensorUtils.hpp> @@ -175,6 +177,10 @@ private: armcomputetensorutils::CopyArmComputeITensorData(this->GetTensor(), static_cast<uint8_t*>(memory)); break; + case arm_compute::DataType::F16: + armcomputetensorutils::CopyArmComputeITensorData(this->GetTensor(), + static_cast<armnn::Half*>(memory)); + break; case arm_compute::DataType::S16: case arm_compute::DataType::QSYMM16: armcomputetensorutils::CopyArmComputeITensorData(this->GetTensor(), @@ -201,6 +207,10 @@ private: armcomputetensorutils::CopyArmComputeITensorData(static_cast<const uint8_t*>(memory), this->GetTensor()); break; + case arm_compute::DataType::F16: + armcomputetensorutils::CopyArmComputeITensorData(static_cast<const armnn::Half*>(memory), + this->GetTensor()); + break; case arm_compute::DataType::S16: case arm_compute::DataType::QSYMM16: armcomputetensorutils::CopyArmComputeITensorData(static_cast<const int16_t*>(memory), @@ -319,4 +329,4 @@ private: ITensorHandle* parentHandle = nullptr; }; -} // namespace armnn
\ No newline at end of file +} // namespace armnn diff --git a/src/backends/neon/test/NeonLayerTests.cpp b/src/backends/neon/test/NeonLayerTests.cpp index 745d2ceece..38771833bd 100644 --- a/src/backends/neon/test/NeonLayerTests.cpp +++ b/src/backends/neon/test/NeonLayerTests.cpp @@ -116,6 +116,11 @@ ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwFloat32_2, DepthToSpaceTest2<DataType::Floa ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwFloat32_3, DepthToSpaceTest3<DataType::Float32>, DataLayout::NCHW); ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwFloat32_4, DepthToSpaceTest4<DataType::Float32>, DataLayout::NCHW); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwFloat16_1, DepthToSpaceTest1<DataType::Float16>, DataLayout::NCHW); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwFloat16_2, DepthToSpaceTest2<DataType::Float16>, DataLayout::NCHW); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwFloat16_3, DepthToSpaceTest3<DataType::Float16>, DataLayout::NCHW); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwFloat16_4, DepthToSpaceTest4<DataType::Float16>, DataLayout::NCHW); + ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwUint8_1, DepthToSpaceTest1<DataType::QuantisedAsymm8>, DataLayout::NCHW); ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwUint8_2, DepthToSpaceTest2<DataType::QuantisedAsymm8>, DataLayout::NCHW); ARMNN_AUTO_TEST_CASE(DepthToSpaceNchwUint8_3, DepthToSpaceTest3<DataType::QuantisedAsymm8>, DataLayout::NCHW); @@ -131,6 +136,11 @@ ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcFloat32_2, DepthToSpaceTest2<DataType::Floa ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcFloat32_3, DepthToSpaceTest3<DataType::Float32>, DataLayout::NHWC); ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcFloat32_4, DepthToSpaceTest4<DataType::Float32>, DataLayout::NHWC); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcFloat16_1, DepthToSpaceTest1<DataType::Float16>, DataLayout::NHWC); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcFloat16_2, DepthToSpaceTest2<DataType::Float16>, DataLayout::NHWC); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcFloat16_3, DepthToSpaceTest3<DataType::Float16>, DataLayout::NHWC); +ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcFloat16_4, DepthToSpaceTest4<DataType::Float16>, DataLayout::NHWC); + ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcUint8_1, DepthToSpaceTest1<DataType::QuantisedAsymm8>, DataLayout::NHWC); ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcUint8_2, DepthToSpaceTest2<DataType::QuantisedAsymm8>, DataLayout::NHWC); ARMNN_AUTO_TEST_CASE(DepthToSpaceNhwcUint8_3, DepthToSpaceTest3<DataType::QuantisedAsymm8>, DataLayout::NHWC); |