24.02
TosaRefTensorHandleFactory.hpp
Go to the documentation of this file.
1
//
2
// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
6
#pragma once
7
8
#include "
TosaRefMemoryManager.hpp
"
9
10
#include <
armnn/backends/ITensorHandleFactory.hpp
>
11
12
namespace
armnn
13
{
14
15
constexpr
const
char
*
TosaRefTensorHandleFactoryId
() {
return
"Arm/TosaRef/TensorHandleFactory"
; }
16
17
class
TosaRefTensorHandleFactory
:
public
ITensorHandleFactory
18
{
19
20
public
:
21
TosaRefTensorHandleFactory
(std::shared_ptr<TosaRefMemoryManager> mgr)
22
: m_MemoryManager(mgr)
23
, m_ImportFlags(static_cast<
MemorySourceFlags
>(
MemorySource
::
Malloc
))
24
, m_ExportFlags(static_cast<
MemorySourceFlags
>(
MemorySource
::
Malloc
))
25
{}
26
27
std::unique_ptr<ITensorHandle>
CreateSubTensorHandle
(
ITensorHandle
& parent,
28
TensorShape
const
& subTensorShape,
29
unsigned
int
const
* subTensorOrigin)
const override
;
30
31
std::unique_ptr<ITensorHandle>
CreateTensorHandle
(
const
TensorInfo
& tensorInfo)
const override
;
32
33
std::unique_ptr<ITensorHandle>
CreateTensorHandle
(
const
TensorInfo
& tensorInfo,
34
DataLayout
dataLayout)
const override
;
35
36
std::unique_ptr<ITensorHandle>
CreateTensorHandle
(
const
TensorInfo
& tensorInfo,
37
const
bool
IsMemoryManaged)
const override
;
38
39
std::unique_ptr<ITensorHandle>
CreateTensorHandle
(
const
TensorInfo
& tensorInfo,
40
DataLayout
dataLayout,
41
const
bool
IsMemoryManaged)
const override
;
42
43
static
const
FactoryId
&
GetIdStatic
();
44
45
const
FactoryId
&
GetId
()
const override
;
46
47
bool
SupportsSubTensors
()
const override
;
48
49
MemorySourceFlags
GetExportFlags
()
const override
;
50
51
MemorySourceFlags
GetImportFlags
()
const override
;
52
53
private
:
54
mutable
std::shared_ptr<TosaRefMemoryManager> m_MemoryManager;
55
MemorySourceFlags
m_ImportFlags;
56
MemorySourceFlags
m_ExportFlags;
57
58
};
59
60
}
// namespace armnn
61
armnn::MemorySource::Malloc
@ Malloc
armnn::TosaRefTensorHandleFactory::GetId
const FactoryId & GetId() const override
Definition:
TosaRefTensorHandleFactory.cpp:71
armnn::DataLayout
DataLayout
Definition:
Types.hpp:62
armnn::TosaRefTensorHandleFactory::SupportsSubTensors
bool SupportsSubTensors() const override
Definition:
TosaRefTensorHandleFactory.cpp:76
armnn::TensorInfo
Definition:
Tensor.hpp:152
armnn::TosaRefTensorHandleFactory::TosaRefTensorHandleFactory
TosaRefTensorHandleFactory(std::shared_ptr< TosaRefMemoryManager > mgr)
Definition:
TosaRefTensorHandleFactory.hpp:21
armnn::MemorySourceFlags
unsigned int MemorySourceFlags
Definition:
MemorySources.hpp:15
ITensorHandleFactory.hpp
armnn::ITensorHandle
Definition:
ITensorHandle.hpp:16
TosaRefMemoryManager.hpp
armnn::TosaRefTensorHandleFactory::GetImportFlags
MemorySourceFlags GetImportFlags() const override
Definition:
TosaRefTensorHandleFactory.cpp:86
armnn::TensorShape
Definition:
Tensor.hpp:20
armnn::TosaRefTensorHandleFactory::GetExportFlags
MemorySourceFlags GetExportFlags() const override
Definition:
TosaRefTensorHandleFactory.cpp:81
armnn::FactoryId
ITensorHandleFactory::FactoryId FactoryId
Definition:
MockTensorHandleFactory.cpp:12
armnn::ITensorHandleFactory
Definition:
ITensorHandleFactory.hpp:46
armnn::TosaRefTensorHandleFactory::GetIdStatic
static const FactoryId & GetIdStatic()
Definition:
TosaRefTensorHandleFactory.cpp:16
armnn::TosaRefTensorHandleFactory
Definition:
TosaRefTensorHandleFactory.hpp:17
armnn::TosaRefTensorHandleFactoryId
constexpr const char * TosaRefTensorHandleFactoryId()
Definition:
TosaRefTensorHandleFactory.hpp:15
armnn::MemorySource
MemorySource
Define the Memory Source to reduce copies.
Definition:
Types.hpp:244
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
armnn::TosaRefTensorHandleFactory::CreateTensorHandle
std::unique_ptr< ITensorHandle > CreateTensorHandle(const TensorInfo &tensorInfo) const override
Definition:
TosaRefTensorHandleFactory.cpp:31
armnn::TosaRefTensorHandleFactory::CreateSubTensorHandle
std::unique_ptr< ITensorHandle > CreateSubTensorHandle(ITensorHandle &parent, TensorShape const &subTensorShape, unsigned int const *subTensorOrigin) const override
Definition:
TosaRefTensorHandleFactory.cpp:22
src
backends
tosaReference
TosaRefTensorHandleFactory.hpp
Generated on Wed Feb 14 2024 16:36:17 for Arm NN by
1.8.17