ArmNN
 25.11
Loading...
Searching...
No Matches
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>
11
12namespace armnn
13{
14
16{
17 void Apply(const std::string& errorMessage = "") { throw UnimplementedException(errorMessage); };
18};
19
21{
22 void Apply(const std::string&) {};
23};
24
25/// Strategy base class with empty implementations.
26template <typename DefaultStrategy>
27class StrategyBase : public IStrategy
28{
29protected:
30 virtual ~StrategyBase() {};
31
32public:
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 {
45 }
46 }
47 }
48
49protected:
50 DefaultStrategy m_DefaultStrategy;
51
52};
53
54
55} // namespace armnn
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition INetwork.hpp:81
virtual LayerType GetType() const =0
Returns the armnn::LayerType of this layer.
Strategy base class with empty implementations.
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
DefaultStrategy m_DefaultStrategy
Copyright (c) 2021 ARM Limited and Contributors.
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition Types.hpp:311
const char * GetLayerTypeAsCString(LayerType type)
void IgnoreUnused(Ts &&...)
Base class for all descriptors.
void Apply(const std::string &)
void Apply(const std::string &errorMessage="")