aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/RefTensorHandleFactory.cpp
blob: c97a779cb362be4e6191d81e63570c41561f9f67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "RefTensorHandleFactory.hpp"
#include "RefTensorHandle.hpp"

#include <boost/core/ignore_unused.hpp>

namespace armnn
{

using FactoryId = ITensorHandleFactory::FactoryId;

const FactoryId& RefTensorHandleFactory::GetIdStatic()
{
    static const FactoryId s_Id(RefTensorHandleFactoryId());
    return s_Id;
}

std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateSubTensorHandle(ITensorHandle& parent,
                                                                             TensorShape const& subTensorShape,
                                                                             unsigned int const* subTensorOrigin) const
{
    boost::ignore_unused(parent, subTensorShape, subTensorOrigin);
    return nullptr;
}

std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo) const
{
    return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags);
}

std::unique_ptr<ITensorHandle> RefTensorHandleFactory::CreateTensorHandle(const TensorInfo& tensorInfo,
                                                                          DataLayout dataLayout) const
{
    boost::ignore_unused(dataLayout);
    return std::make_unique<RefTensorHandle>(tensorInfo, m_MemoryManager, m_ImportFlags);
}

const FactoryId& RefTensorHandleFactory::GetId() const
{
    return GetIdStatic();
}

bool RefTensorHandleFactory::SupportsSubTensors() const
{
    return false;
}

MemorySourceFlags RefTensorHandleFactory::GetExportFlags() const
{
    return m_ExportFlags;
}

MemorySourceFlags RefTensorHandleFactory::GetImportFlags() const
{
    return m_ImportFlags;
}

} // namespace armnn