Files
rk35xx-android14/external/android-nn-driver/test/TestHalfTensor.hpp
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

39 lines
753 B
C++

//
// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include <ArmnnDriver.hpp>
#include "DriverTestHelpers.hpp"
#include <half/half.hpp>
using Half = half_float::half;
namespace driverTestHelpers
{
class TestHalfTensor
{
public:
TestHalfTensor(const armnn::TensorShape & shape,
const std::vector<Half> & data)
: m_Shape{shape}
, m_Data{data}
{
DOCTEST_CHECK(m_Shape.GetNumElements() == m_Data.size());
}
hidl_vec<uint32_t> GetDimensions() const;
unsigned int GetNumElements() const;
const Half * GetData() const;
private:
armnn::TensorShape m_Shape;
std::vector<Half> m_Data;
};
} // driverTestHelpers