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 | |
Mike Kelly | b6de7a1 | 2023-07-18 12:03:41 +0100 | [diff] [blame] | 32 | arm_compute::ITensorInfo* NeonTensorDecorator::info() const |
Mike Kelly | 4cc341c | 2023-07-07 15:43:06 +0100 | [diff] [blame] | 33 | { |
| 34 | return &m_TensorInfo; |
| 35 | } |
| 36 | |
Mike Kelly | b6de7a1 | 2023-07-18 12:03:41 +0100 | [diff] [blame] | 37 | arm_compute::ITensorInfo* NeonTensorDecorator::info() |
Mike Kelly | 4cc341c | 2023-07-07 15:43:06 +0100 | [diff] [blame] | 38 | { |
| 39 | return &m_TensorInfo; |
| 40 | } |
| 41 | |
Mike Kelly | b6de7a1 | 2023-07-18 12:03:41 +0100 | [diff] [blame] | 42 | uint8_t* NeonTensorDecorator::buffer() const |
Mike Kelly | 4cc341c | 2023-07-07 15:43:06 +0100 | [diff] [blame] | 43 | { |
| 44 | return m_Original->buffer(); |
| 45 | } |
| 46 | |
| 47 | } |