Ferran Balaguer | bfeb271 | 2019-08-07 15:14:56 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "RefTensorHandleFactory.hpp" |
| 7 | #include "RefTensorHandle.hpp" |
| 8 | |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 9 | #include <armnn/utility/IgnoreUnused.hpp> |
Ferran Balaguer | bfeb271 | 2019-08-07 15:14:56 +0100 | [diff] [blame] | 10 | |
| 11 | namespace armnn |
| 12 | { |
| 13 | |
| 14 | using FactoryId = ITensorHandleFactory::FactoryId; |
| 15 | |
| 16 | const FactoryId& RefTensorHandleFactory::GetIdStatic() |
| 17 | { |
| 18 | static const FactoryId s_Id(RefTensorHandleFactoryId()); |
| 19 | return s_Id; |
| 20 | } |
| 21 | |
| 22 | std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateSubTensorHandle(ITensorHandle& parent, |
| 23 | TensorShape const& subTensorShape, |
| 24 | unsigned int const* subTensorOrigin) const |
| 25 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 26 | IgnoreUnused(parent, subTensorShape, subTensorOrigin); |
Ferran Balaguer | bfeb271 | 2019-08-07 15:14:56 +0100 | [diff] [blame] | 27 | return nullptr; |
| 28 | } |
| 29 | |
David Monahan | c6e5a6e | 2019-10-02 09:33:57 +0100 | [diff] [blame] | 30 | std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo) const |
Ferran Balaguer | bfeb271 | 2019-08-07 15:14:56 +0100 | [diff] [blame] | 31 | { |
| 32 | return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags); |
| 33 | } |
| 34 | |
| 35 | std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo, |
David Monahan | c6e5a6e | 2019-10-02 09:33:57 +0100 | [diff] [blame] | 36 | DataLayout dataLayout) const |
Ferran Balaguer | bfeb271 | 2019-08-07 15:14:56 +0100 | [diff] [blame] | 37 | { |
Jan Eilers | 8eb2560 | 2020-03-09 12:13:48 +0000 | [diff] [blame] | 38 | IgnoreUnused(dataLayout); |
Ferran Balaguer | bfeb271 | 2019-08-07 15:14:56 +0100 | [diff] [blame] | 39 | return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags); |
| 40 | } |
| 41 | |
| 42 | const FactoryId& RefTensorHandleFactory::GetId() const |
| 43 | { |
| 44 | return GetIdStatic(); |
| 45 | } |
| 46 | |
| 47 | bool RefTensorHandleFactory::SupportsSubTensors() const |
| 48 | { |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | MemorySourceFlags RefTensorHandleFactory::GetExportFlags() const |
| 53 | { |
| 54 | return m_ExportFlags; |
| 55 | } |
| 56 | |
| 57 | MemorySourceFlags RefTensorHandleFactory::GetImportFlags() const |
| 58 | { |
| 59 | return m_ImportFlags; |
| 60 | } |
| 61 | |
| 62 | } // namespace armnn |