24.02
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
Variables
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
w
Enumerations
a
b
c
d
e
f
g
j
l
m
n
o
p
q
r
s
t
u
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
c
d
e
f
i
j
l
m
o
p
r
s
v
w
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
l
m
o
r
s
t
u
v
x
z
Functions
a
b
c
g
i
m
r
s
t
v
z
Variables
Typedefs
Macros
a
c
d
e
f
h
i
l
o
s
t
u
v
x
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
StrategyBase.hpp
Go to the documentation of this file.
1
//
2
// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
#pragma once
6
7
8
#include <
armnn/INetwork.hpp
>
9
#include <
armnn/IStrategy.hpp
>
10
#include <
armnn/utility/IgnoreUnused.hpp
>
11
12
namespace
armnn
13
{
14
15
struct
ThrowingStrategy
16
{
17
void
Apply
(
const
std::string& errorMessage =
""
) {
throw
UnimplementedException
(errorMessage); };
18
};
19
20
struct
NoThrowStrategy
21
{
22
void
Apply
(
const
std::string&) {};
23
};
24
25
/// Strategy base class with empty implementations.
26
template
<
typename
DefaultStrategy>
27
class
StrategyBase
:
public
IStrategy
28
{
29
protected
:
30
virtual
~StrategyBase
() {};
31
32
public
:
33
virtual
void
ExecuteStrategy
(
const
armnn::IConnectableLayer
* layer,
34
const
armnn::BaseDescriptor
& descriptor,
35
const
std::vector<armnn::ConstTensor>& constants,
36
const
char
* name,
37
const
armnn::LayerBindingId
id
= 0)
override
38
{
39
armnn::IgnoreUnused
(descriptor, constants,
id
, name);
40
switch
(layer->
GetType
())
41
{
42
default
:
43
{
44
m_DefaultStrategy
.Apply(
GetLayerTypeAsCString
(layer->
GetType
()));
45
}
46
}
47
}
48
49
protected
:
50
DefaultStrategy
m_DefaultStrategy
;
51
52
};
53
54
55
}
// namespace armnn
armnn::StrategyBase::m_DefaultStrategy
DefaultStrategy m_DefaultStrategy
Definition:
StrategyBase.hpp:50
armnn::StrategyBase
Strategy base class with empty implementations.
Definition:
StrategyBase.hpp:27
armnn::GetLayerTypeAsCString
const char * GetLayerTypeAsCString(LayerType type)
Definition:
InternalTypes.cpp:13
IgnoreUnused.hpp
armnn::IStrategy
Definition:
IStrategy.hpp:16
armnn::ThrowingStrategy
Definition:
StrategyBase.hpp:15
INetwork.hpp
armnn::LayerBindingId
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition:
Types.hpp:309
armnn::ThrowingStrategy::Apply
void Apply(const std::string &errorMessage="")
Definition:
StrategyBase.hpp:17
armnn::NoThrowStrategy
Definition:
StrategyBase.hpp:20
armnn::IConnectableLayer::GetType
virtual LayerType GetType() const =0
Returns the armnn::LayerType of this layer.
armnn::BaseDescriptor
Base class for all descriptors.
Definition:
Descriptors.hpp:22
IStrategy.hpp
armnn::StrategyBase::ExecuteStrategy
virtual void ExecuteStrategy(const armnn::IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0) override
Definition:
StrategyBase.hpp:33
armnn::IgnoreUnused
void IgnoreUnused(Ts &&...)
Definition:
IgnoreUnused.hpp:14
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
armnn::StrategyBase::~StrategyBase
virtual ~StrategyBase()
Definition:
StrategyBase.hpp:30
armnn::IConnectableLayer
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition:
INetwork.hpp:80
armnn::UnimplementedException
Definition:
Exceptions.hpp:98
armnn::NoThrowStrategy::Apply
void Apply(const std::string &)
Definition:
StrategyBase.hpp:22
include
armnn
StrategyBase.hpp
Generated on Wed Feb 14 2024 16:36:13 for Arm NN by
1.8.17