blob: 2b7870f42e43da4823d92c54fb0821eeadcb5147 [file] [log] [blame]
Cathal Corbett0637bf32022-12-20 18:35:34 +00001//
2// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
8#include <ArmnnDriver.hpp>
9#include "DriverTestHelpers.hpp"
10
11#include <half/half.hpp>
12
13using Half = half_float::half;
14
15namespace driverTestHelpers
16{
17
18class TestHalfTensor
19{
20public:
21 TestHalfTensor(const armnn::TensorShape & shape,
22 const std::vector<Half> & data)
23 : m_Shape{shape}
24 , m_Data{data}
25 {
26 DOCTEST_CHECK(m_Shape.GetNumElements() == m_Data.size());
27 }
28
29 hidl_vec<uint32_t> GetDimensions() const;
30 unsigned int GetNumElements() const;
31 const Half * GetData() const;
32
33private:
34 armnn::TensorShape m_Shape;
35 std::vector<Half> m_Data;
36};
37
38} // driverTestHelpers