blob: 12cdc427b2a4e61b43d67455d55ce53efd08f3aa [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#include "TestHalfTensor.hpp"
7
8namespace driverTestHelpers
9{
10
11hidl_vec<uint32_t> TestHalfTensor::GetDimensions() const
12{
13 hidl_vec<uint32_t> dimensions;
14 dimensions.resize(m_Shape.GetNumDimensions());
15 for (uint32_t i=0; i<m_Shape.GetNumDimensions(); ++i)
16 {
17 dimensions[i] = m_Shape[i];
18 }
19 return dimensions;
20}
21
22unsigned int TestHalfTensor::GetNumElements() const
23{
24 return m_Shape.GetNumElements();
25}
26
27const Half * TestHalfTensor::GetData() const
28{
29 DOCTEST_CHECK(m_Data.empty() == false);
30 return &m_Data[0];
31}
32
33} // namespace driverTestHelpers