diff options
author | Francis Murtagh <francis.murtagh@arm.com> | 2021-09-28 15:30:31 +0100 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2021-10-06 15:37:37 +0000 |
commit | ca49a24a2b19e4d8e45efc53e336223c5895f25a (patch) | |
tree | 37e14b5bec459e8a9ceb96557959176ba26fd56e /src/backends/backendsCommon/memoryOptimizationStrategies/MemoryOptimizerStrategyValidator.hpp | |
parent | eb5f810ad985a8cca831b46d94ee73db5a305c9f (diff) | |
download | armnn-ca49a24a2b19e4d8e45efc53e336223c5895f25a.tar.gz |
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 <francis.murtagh@arm.com>
Change-Id: I7a779b35538ecf18a33b62b84512eba69eda1f86
Diffstat (limited to 'src/backends/backendsCommon/memoryOptimizationStrategies/MemoryOptimizerStrategyValidator.hpp')
-rw-r--r-- | src/backends/backendsCommon/memoryOptimizationStrategies/MemoryOptimizerStrategyValidator.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/backends/backendsCommon/memoryOptimizationStrategies/MemoryOptimizerStrategyValidator.hpp b/src/backends/backendsCommon/memoryOptimizationStrategies/MemoryOptimizerStrategyValidator.hpp new file mode 100644 index 0000000000..13e90593d8 --- /dev/null +++ b/src/backends/backendsCommon/memoryOptimizationStrategies/MemoryOptimizerStrategyValidator.hpp @@ -0,0 +1,27 @@ +// +// Copyright © 2021 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// +#pragma once + +#include <armnn/Types.hpp> +#include <armnn/backends/IMemoryOptimizerStrategy.hpp> + +namespace armnn +{ + +class MemoryOptimizerValidator +{ +public: + explicit MemoryOptimizerValidator(std::shared_ptr<IMemoryOptimizerStrategy> strategy) + : m_Strategy(strategy) + { + }; + + bool Validate(std::vector<MemBlock>& memBlocks); + +private: + std::shared_ptr<IMemoryOptimizerStrategy> m_Strategy; +}; + +} // namespace armnn
\ No newline at end of file |