ArmNN
 24.08
ConstantMemoryStrategy Class Reference

#include <ConstantMemoryStrategy.hpp>

Inheritance diagram for ConstantMemoryStrategy:
[legend]
Collaboration diagram for ConstantMemoryStrategy:
[legend]

Public Member Functions

 ConstantMemoryStrategy ()
 
std::string GetName () const override
 
MemBlockStrategyType GetMemBlockStrategyType () const override
 
std::vector< MemBinOptimize (std::vector< MemBlock > &memBlocks) override
 
- Public Member Functions inherited from IMemoryOptimizerStrategy
virtual ~IMemoryOptimizerStrategy ()
 

Detailed Description

Definition at line 13 of file ConstantMemoryStrategy.hpp.

Constructor & Destructor Documentation

◆ ConstantMemoryStrategy()

Definition at line 16 of file ConstantMemoryStrategy.hpp.

17  : m_Name(std::string("ConstantMemoryStrategy"))
18  , m_MemBlockStrategyType(MemBlockStrategyType::SingleAxisPacking) {}

References armnn::SingleAxisPacking.

Member Function Documentation

◆ GetMemBlockStrategyType()

MemBlockStrategyType GetMemBlockStrategyType ( ) const
overridevirtual

Implements IMemoryOptimizerStrategy.

Definition at line 16 of file ConstantMemoryStrategy.cpp.

17 {
18  return m_MemBlockStrategyType;
19 }

◆ GetName()

std::string GetName ( ) const
overridevirtual

Implements IMemoryOptimizerStrategy.

Definition at line 11 of file ConstantMemoryStrategy.cpp.

12 {
13  return m_Name;
14 }

◆ Optimize()

std::vector< MemBin > Optimize ( std::vector< MemBlock > &  memBlocks)
overridevirtual

Implements IMemoryOptimizerStrategy.

Definition at line 25 of file ConstantMemoryStrategy.cpp.

26 {
27  std::vector<MemBin> memBins;
28  memBins.reserve(memBlocks.size());
29 
30  for (auto& memBlock : memBlocks)
31  {
32  MemBin memBin;
33  memBin.m_MemSize = memBlock.m_MemSize;
34  memBin.m_MemBlocks.reserve(1);
35  memBlock.m_Offset = 0;
36  memBin.m_MemBlocks.push_back(memBlock);
37  memBins.push_back(memBin);
38  }
39 
40  return memBins;
41 }

References MemBin::m_MemBlocks, and MemBin::m_MemSize.


The documentation for this class was generated from the following files:
armnn::MemBlockStrategyType::SingleAxisPacking
@ SingleAxisPacking