From 9da19e9da660057785fb736aba5c61b1ae773f2f Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 11 Oct 2018 15:33:11 +0100 Subject: COMPMID-1605: API alignment for the MemoryManager with ARMNN Change-Id: Iac6a95ba7f388e65b7f1c8865c3e9bf289b233ea Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/155490 Reviewed-by: Anthony Barbier Tested-by: bsgcomp --- arm_compute/runtime/MemoryManagerOnDemand.h | 33 ++++++----------------------- 1 file changed, 6 insertions(+), 27 deletions(-) (limited to 'arm_compute/runtime/MemoryManagerOnDemand.h') diff --git a/arm_compute/runtime/MemoryManagerOnDemand.h b/arm_compute/runtime/MemoryManagerOnDemand.h index ad4b831e1f..43f557effc 100644 --- a/arm_compute/runtime/MemoryManagerOnDemand.h +++ b/arm_compute/runtime/MemoryManagerOnDemand.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -21,23 +21,19 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef __ARM_COMPUTE_MEMORYMANAGERONDEMAND_H__ -#define __ARM_COMPUTE_MEMORYMANAGERONDEMAND_H__ +#ifndef __ARM_COMPUTE_MEMORY_MANAGER_ON_DEMAND_H__ +#define __ARM_COMPUTE_MEMORY_MANAGER_ON_DEMAND_H__ #include "arm_compute/runtime/IMemoryManager.h" -#include "IAllocator.h" #include "arm_compute/runtime/ILifetimeManager.h" #include "arm_compute/runtime/IMemoryGroup.h" #include "arm_compute/runtime/IPoolManager.h" #include -#include namespace arm_compute { -class IAllocator; - /** On-demand memory manager */ class MemoryManagerOnDemand : public IMemoryManager { @@ -52,33 +48,16 @@ public: MemoryManagerOnDemand(MemoryManagerOnDemand &&) = default; /** Allow instances of this class to be moved */ MemoryManagerOnDemand &operator=(MemoryManagerOnDemand &&) = default; - /** Sets the number of pools to create - * - * @param[in] num_pools Number of pools - */ - void set_num_pools(unsigned int num_pools); - /** Sets the allocator to be used for configuring the pools - * - * @param[in] allocator Allocator to use - */ - void set_allocator(IAllocator *allocator); - /** Checks if the memory manager has been finalized - * - * @return True if the memory manager has been finalized else false - */ - bool is_finalized() const; // Inherited methods overridden: ILifetimeManager *lifetime_manager() override; IPoolManager *pool_manager() override; - void finalize() override; + void populate(IAllocator &allocator, size_t num_pools) override; + void clear() override; private: std::shared_ptr _lifetime_mgr; /**< Lifetime manager */ std::shared_ptr _pool_mgr; /**< Memory pool manager */ - IAllocator *_allocator; /**< Allocator used for backend allocations */ - bool _is_finalized; /**< Flag that notes if the memory manager has been finalized */ - unsigned int _num_pools; /**< Number of pools to create */ }; } // arm_compute -#endif /*__ARM_COMPUTE_MEMORYMANAGERONDEMAND_H__ */ +#endif /*__ARM_COMPUTE_MEMORY_MANAGER_ON_DEMAND_H__ */ -- cgit v1.2.1