Finn Williams | f9d96e5 | 2021-10-27 11:25:02 +0100 | [diff] [blame^] | 1 | // |
| 2 | // Copyright © 2021 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | size_t GetMinPossibleMemorySize(const std::vector<armnn::MemBlock>& blocks) |
| 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 | } |
| 25 | |
| 26 | // Generated from fsrcnn_720p.tflite |
| 27 | std::vector<armnn::MemBlock> fsrcnn |
| 28 | { |
| 29 | { 0, 1, 691200, 0, 0 }, |
| 30 | { 1, 3, 7372800, 0, 1 }, |
| 31 | { 2, 5, 7372800, 0, 2 }, |
| 32 | { 3, 7, 1843200, 0, 3 }, |
| 33 | { 4, 9, 1843200, 0, 4 }, |
| 34 | { 5, 11, 1843200, 0, 5 }, |
| 35 | { 6, 13, 1843200, 0, 6 }, |
| 36 | { 7, 15, 1843200, 0, 7 }, |
| 37 | { 8, 17, 1843200, 0, 8 }, |
| 38 | { 9, 19, 7372800, 0, 9 }, |
| 39 | { 10, 21, 7372800, 0, 10 }, |
| 40 | { 11, 23, 2764800, 0, 11 }, |
| 41 | { 12, 25, 2764800, 0, 12 }, |
| 42 | { 13, 27, 2764800, 0, 13 } |
| 43 | }; |