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 GetDimensions() const11hidl_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 GetNumElements() const22unsigned int TestHalfTensor::GetNumElements() const 23 { 24 return m_Shape.GetNumElements(); 25 } 26 GetData() const27const Half * TestHalfTensor::GetData() const 28 { 29 DOCTEST_CHECK(m_Data.empty() == false); 30 return &m_Data[0]; 31 } 32 33 } // namespace driverTestHelpers 34