24.08
ConstantMemoryStrategy.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
#include <
armnn/Types.hpp
>
8
#include <
armnn/backends/IMemoryOptimizerStrategy.hpp
>
9
10
namespace
armnn
11
{
12
// ConstLayerMemoryOptimizer: Create a unique MemBin for each MemBlock and assign it an offset of 0
13
class
ConstantMemoryStrategy
:
public
IMemoryOptimizerStrategy
14
{
15
public
:
16
ConstantMemoryStrategy
()
17
: m_Name(
std
::string(
"ConstantMemoryStrategy"
))
18
, m_MemBlockStrategyType(
MemBlockStrategyType
::
SingleAxisPacking
) {}
19
20
std::string
GetName
()
const override
;
21
22
MemBlockStrategyType
GetMemBlockStrategyType
()
const override
;
23
24
std::vector<MemBin>
Optimize
(std::vector<MemBlock>& memBlocks)
override
;
25
26
private
:
27
std::string m_Name;
28
MemBlockStrategyType
m_MemBlockStrategyType;
29
};
30
31
}
// namespace armnn
IMemoryOptimizerStrategy.hpp
armnn::ConstantMemoryStrategy::ConstantMemoryStrategy
ConstantMemoryStrategy()
Definition:
ConstantMemoryStrategy.hpp:16
armnn::IMemoryOptimizerStrategy
Definition:
IMemoryOptimizerStrategy.hpp:45
armnn::MemBlockStrategyType
MemBlockStrategyType
Definition:
Types.hpp:253
armnn::MemBlockStrategyType::SingleAxisPacking
@ SingleAxisPacking
armnn::ConstantMemoryStrategy::GetName
std::string GetName() const override
Definition:
ConstantMemoryStrategy.cpp:11
std
Definition:
BackendId.hpp:149
armnn::ConstantMemoryStrategy
Definition:
ConstantMemoryStrategy.hpp:13
armnn::ConstantMemoryStrategy::GetMemBlockStrategyType
MemBlockStrategyType GetMemBlockStrategyType() const override
Definition:
ConstantMemoryStrategy.cpp:16
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
Types.hpp
armnn::ConstantMemoryStrategy::Optimize
std::vector< MemBin > Optimize(std::vector< MemBlock > &memBlocks) override
Definition:
ConstantMemoryStrategy.cpp:25
src
backends
backendsCommon
memoryOptimizerStrategyLibrary
strategies
ConstantMemoryStrategy.hpp
Generated on Wed Aug 28 2024 14:31:49 for Arm NN by
1.8.17