blob: 249c133a0f1cbe19e5a45f9b2c73b65e964dba64 [file] [log] [blame]
Sadik Armagan932cf3f2021-09-15 09:22:11 +01001//
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
10namespace armnn
11{
12// ConstLayerMemoryOptimizer: Create a unique MemBin for each MemBlock and assign it an offset of 0
Jim Flynne1fdd282021-10-26 21:26:10 +010013class ConstantMemoryStrategy : public IMemoryOptimizerStrategy
Sadik Armagan932cf3f2021-09-15 09:22:11 +010014{
15public:
Jim Flynne1fdd282021-10-26 21:26:10 +010016 ConstantMemoryStrategy()
17 : m_Name(std::string("ConstantMemoryStrategy"))
Sadik Armagan932cf3f2021-09-15 09:22:11 +010018 , 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
26private:
27 std::string m_Name;
28 MemBlockStrategyType m_MemBlockStrategyType;
29};
30
31} // namespace armnn