ArmNN
 22.05
TestMemBlocks.hpp File Reference

Go to the source code of this file.

Functions

size_t GetMinPossibleMemorySize (const std::vector< armnn::MemBlock > &blocks)
 

Variables

std::vector< armnn::MemBlockfsrcnn
 

Function Documentation

◆ GetMinPossibleMemorySize()

size_t GetMinPossibleMemorySize ( const std::vector< armnn::MemBlock > &  blocks)

Definition at line 6 of file TestMemBlocks.hpp.

References fsrcnn.

Referenced by TEST_SUITE().

7 {
8  unsigned int maxLifetime = 0;
9  for (auto& block: blocks)
10  {
11  maxLifetime = std::max(maxLifetime, block.m_EndOfLife);
12  }
13  maxLifetime++;
14 
15  std::vector<size_t> lifetimes(maxLifetime);
16  for (const auto& block : blocks)
17  {
18  for (auto lifetime = block.m_StartOfLife; lifetime <= block.m_EndOfLife; ++lifetime)
19  {
20  lifetimes[lifetime] += block.m_MemSize;
21  }
22  }
23  return *std::max_element(lifetimes.begin(), lifetimes.end());
24 }

Variable Documentation

◆ fsrcnn

std::vector<armnn::MemBlock> fsrcnn
Initial value:
{
{ 0, 1, 691200, 0, 0 },
{ 1, 3, 7372800, 0, 1 },
{ 2, 5, 7372800, 0, 2 },
{ 3, 7, 1843200, 0, 3 },
{ 4, 9, 1843200, 0, 4 },
{ 5, 11, 1843200, 0, 5 },
{ 6, 13, 1843200, 0, 6 },
{ 7, 15, 1843200, 0, 7 },
{ 8, 17, 1843200, 0, 8 },
{ 9, 19, 7372800, 0, 9 },
{ 10, 21, 7372800, 0, 10 },
{ 11, 23, 2764800, 0, 11 },
{ 12, 25, 2764800, 0, 12 },
{ 13, 27, 2764800, 0, 13 }
}

Definition at line 28 of file TestMemBlocks.hpp.

Referenced by GetMinPossibleMemorySize(), and TEST_SUITE().