From ca49a24a2b19e4d8e45efc53e336223c5895f25a Mon Sep 17 00:00:00 2001 From: Francis Murtagh Date: Tue, 28 Sep 2021 15:30:31 +0100 Subject: IVGCVSW-6338 IMemoryOptimizerStrategy Create a wrapper validator strategy * Add validator wrapper * Add validation logic: Condition #1: All Memblocks have been assigned to a MemBin Condition #2: No Memblock is assigned to multiple MemBins Condition #3: No two Memblocks overlap in both the X and Y axis Memblocks can overlap on the X axis for SingleAxisPacking Memblocks can overlap on the Y axis or the X for MultiAxisPacking but not both * Add test strategies and tests for overlap, duplicates and unassigned blocks Signed-off-by: Francis Murtagh Change-Id: I7a779b35538ecf18a33b62b84512eba69eda1f86 --- include/armnn/backends/IMemoryOptimizerStrategy.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/armnn/backends') diff --git a/include/armnn/backends/IMemoryOptimizerStrategy.hpp b/include/armnn/backends/IMemoryOptimizerStrategy.hpp index ec6d838aae..ad5513f8a3 100644 --- a/include/armnn/backends/IMemoryOptimizerStrategy.hpp +++ b/include/armnn/backends/IMemoryOptimizerStrategy.hpp @@ -22,8 +22,8 @@ struct MemBlock const unsigned int m_StartOfLife; // Y start const unsigned int m_EndOfLife; // Y end - const size_t m_MemSize; // X start - size_t m_Offset; // X end + const size_t m_MemSize; // Offset + Memsize = X end + size_t m_Offset; // X start const unsigned int m_Index; // Index to keep order }; @@ -40,7 +40,7 @@ struct MemBin // A IMemoryOptimizerStrategy must ensure that // 1: All MemBlocks have been assigned to a MemBin // 2: No MemBlock is assigned to multiple MemBins -// 3: No two MemBlocks in a MemBin overlap in the X dimension +// 3: No two Memblocks in a MemBin overlap in both the X and Y axis // (a strategy cannot change the y axis or length of a MemBlock) class IMemoryOptimizerStrategy { -- cgit v1.2.1