Mike Kelly | 4cc341c | 2023-07-07 15:43:06 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2023 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "NeonTensorHandle.hpp" |
| 7 | |
| 8 | #include <aclCommon/ArmComputeTensorUtils.hpp> |
| 9 | |
| 10 | namespace armnn |
| 11 | { |
| 12 | std::shared_ptr<ITensorHandle> NeonTensorHandle::DecorateTensorHandle(const TensorInfo &tensorInfo) |
| 13 | { |
| 14 | auto* parent = const_cast<NeonTensorHandle*>(this); |
| 15 | auto decorated = std::make_shared<NeonTensorHandleDecorator>(parent, tensorInfo); |
| 16 | m_Decorated.emplace_back(decorated); |
| 17 | return decorated; |
| 18 | } |
| 19 | |
| 20 | NeonTensorDecorator::NeonTensorDecorator() |
| 21 | : m_Original(nullptr), m_TensorInfo() |
| 22 | { |
| 23 | } |
| 24 | |
| 25 | NeonTensorDecorator::NeonTensorDecorator(arm_compute::ITensor *parent, const TensorInfo& tensorInfo) |
| 26 | : m_Original(nullptr), m_TensorInfo() |
| 27 | { |
| 28 | m_TensorInfo = armcomputetensorutils::BuildArmComputeTensorInfo(tensorInfo); |
| 29 | m_Original = parent; |
| 30 | } |
| 31 | |
| 32 | arm_compute::ITensorInfo *NeonTensorDecorator::info() const |
| 33 | { |
| 34 | return &m_TensorInfo; |
| 35 | } |
| 36 | |
| 37 | arm_compute::ITensorInfo *NeonTensorDecorator::info() |
| 38 | { |
| 39 | return &m_TensorInfo; |
| 40 | } |
| 41 | |
| 42 | uint8_t *NeonTensorDecorator::buffer() const |
| 43 | { |
| 44 | return m_Original->buffer(); |
| 45 | } |
| 46 | |
| 47 | } |