Cathal Corbett | 0637bf3 | 2022-12-20 18:35:34 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2022 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "TestHalfTensor.hpp" |
| 7 | |
| 8 | namespace driverTestHelpers |
| 9 | { |
| 10 | |
| 11 | hidl_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 | |
| 22 | unsigned int TestHalfTensor::GetNumElements() const |
| 23 | { |
| 24 | return m_Shape.GetNumElements(); |
| 25 | } |
| 26 | |
| 27 | const Half * TestHalfTensor::GetData() const |
| 28 | { |
| 29 | DOCTEST_CHECK(m_Data.empty() == false); |
| 30 | return &m_Data[0]; |
| 31 | } |
| 32 | |
| 33 | } // namespace driverTestHelpers |