From 511347a7282b948bddfc071e9a8fa08e79da25b4 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 18 Sep 2017 18:33:07 +0100 Subject: COMPMID-485: Offset-based memory manager support. Adds support for offset-based memory mappings used from CPU system memory and SVM based allocations. Change-Id: Ibee6a3c02a61df9b11fe8878cfe40dc6fd9a4be0 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88307 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- arm_compute/runtime/BlobLifetimeManager.h | 41 ++++++++----------------------- 1 file changed, 10 insertions(+), 31 deletions(-) (limited to 'arm_compute/runtime/BlobLifetimeManager.h') diff --git a/arm_compute/runtime/BlobLifetimeManager.h b/arm_compute/runtime/BlobLifetimeManager.h index ec43f47fe6..edf4d43421 100644 --- a/arm_compute/runtime/BlobLifetimeManager.h +++ b/arm_compute/runtime/BlobLifetimeManager.h @@ -24,21 +24,20 @@ #ifndef __ARM_COMPUTE_BLOBLIFETIMEMANAGER_H__ #define __ARM_COMPUTE_BLOBLIFETIMEMANAGER_H__ -#include "arm_compute/runtime/ILifetimeManager.h" +#include "arm_compute/runtime/ISimpleLifetimeManager.h" -#include "arm_compute/runtime/IMemoryGroup.h" +#include "arm_compute/runtime/IMemoryPool.h" #include "arm_compute/runtime/Types.h" #include -#include +#include #include namespace arm_compute { -class IMemoryGroup; - -/** Class that tracks the lifetime of registered tensors and calculates the systems memory requirements in terms of blobs */ -class BlobLifetimeManager : public ILifetimeManager +/** Concrete class that tracks the lifetime of registered tensors and + * calculates the systems memory requirements in terms of blobs */ +class BlobLifetimeManager : public ISimpleLifetimeManager { public: /** Constructor */ @@ -53,35 +52,15 @@ public: BlobLifetimeManager &operator=(BlobLifetimeManager &&) = default; // Inherited methods overridden: - void register_group(IMemoryGroup *group) override; - void start_lifetime(void *obj) override; - void end_lifetime(void *obj, void **handle, size_t size) override; std::unique_ptr create_pool(IAllocator *allocator) override; - bool are_all_finalized() const override; MappingType mapping_type() const override; private: - /** Update blobs and mappings */ - void update_blobs_and_mappings(); + // Inherited methods overridden: + void update_blobs_and_mappings() override; private: - /** Element struct */ - struct Element - { - Element(void *id_ = nullptr, void **handle_ = nullptr, size_t size_ = 0, bool status_ = false) - : id(id_), handle(handle_), size(size_), status(status_) - { - } - void *id; /**< Element id */ - void **handle; /**< Element's memory handle */ - size_t size; /**< Element's size */ - bool status; /**< Lifetime status */ - }; - - IMemoryGroup *_active_group; /**< Active group */ - std::vector _active_elements; /**< A map that contains the active elements */ - std::map> _finalized_groups; /**< A map that contains the finalized groups */ - std::vector _blobs; + std::vector _blobs; /**< Memory blobs' sizes */ }; -} // arm_compute +} // namespace arm_compute #endif /* __ARM_COMPUTE_BLOBLIFETIMEMANAGER_H__ */ -- cgit v1.2.1