From 0637bf38b24bba3a3d88f34ed956111a3abddda2 Mon Sep 17 00:00:00 2001 From: Cathal Corbett Date: Tue, 20 Dec 2022 18:35:34 +0000 Subject: IVGCVSW-7211 Fix float16 operators being wrongly unsupported with android-nn-driver. !armnn:8862 * Added float16 mean test cases. * Float16 CTS/CTS pass on CpuAcc. Signed-off-by: Cathal Corbett Change-Id: Ibd9021d0ae4a205cc2c91555f3ae00c6dba84609 --- test/TestHalfTensor.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/TestHalfTensor.hpp (limited to 'test/TestHalfTensor.hpp') diff --git a/test/TestHalfTensor.hpp b/test/TestHalfTensor.hpp new file mode 100644 index 00000000..2b7870f4 --- /dev/null +++ b/test/TestHalfTensor.hpp @@ -0,0 +1,38 @@ +// +// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#pragma once + +#include +#include "DriverTestHelpers.hpp" + +#include + +using Half = half_float::half; + +namespace driverTestHelpers +{ + +class TestHalfTensor +{ +public: + TestHalfTensor(const armnn::TensorShape & shape, + const std::vector & data) + : m_Shape{shape} + , m_Data{data} + { + DOCTEST_CHECK(m_Shape.GetNumElements() == m_Data.size()); + } + + hidl_vec GetDimensions() const; + unsigned int GetNumElements() const; + const Half * GetData() const; + +private: + armnn::TensorShape m_Shape; + std::vector m_Data; +}; + +} // driverTestHelpers -- cgit v1.2.1