diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-11-14 13:16:56 +0000 |
---|---|---|
committer | Isabella Gottardi <isabella.gottardi@arm.com> | 2018-11-21 09:52:04 +0000 |
commit | df3103622b7de05f4e35b22a2c94b4a46eab4efc (patch) | |
tree | 17e10253e7a069c69d10bea0882b699b99d74b86 /arm_compute/runtime/MemoryGroupBase.h | |
parent | c47ef20d69e8ea0f519fdc679435cd7037fc18fe (diff) | |
download | ComputeLibrary-df3103622b7de05f4e35b22a2c94b4a46eab4efc.tar.gz |
COMPMID-1088: Use IMemoryRegion in interfaces where possible
-Simplifies import memory interface
-Changes the used of void** handles with appropriate interfaces.
Change-Id: I5918c855c11f46352058864623336b352162a4b7
Diffstat (limited to 'arm_compute/runtime/MemoryGroupBase.h')
-rw-r--r-- | arm_compute/runtime/MemoryGroupBase.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/arm_compute/runtime/MemoryGroupBase.h b/arm_compute/runtime/MemoryGroupBase.h index 06e4321410..0ceaa900c5 100644 --- a/arm_compute/runtime/MemoryGroupBase.h +++ b/arm_compute/runtime/MemoryGroupBase.h @@ -35,6 +35,9 @@ namespace arm_compute { +// Forward declarations +class IMemory; + /** Memory group */ template <typename TensorType> class MemoryGroupBase : public IMemoryGroup @@ -63,11 +66,12 @@ public: * * @note Manager must not be finalized * - * @param[in] obj Object to request memory for - * @param[in] handle Handle to store the memory - * @param[in] size Size of memory to allocate + * @param[in, out] obj Object to request memory for + * @param[in, out] obj_memory Object's memory handling interface which can be used to alter the underlying memory + * that is used by the object. + * @param[in] size Size of memory to allocate */ - void finalize_memory(TensorType *obj, void **handle, size_t size); + void finalize_memory(TensorType *obj, IMemory &obj_memory, size_t size); // Inherited methods overridden: void acquire() override; @@ -112,16 +116,16 @@ inline void MemoryGroupBase<TensorType>::manage(TensorType *obj) } template <typename TensorType> -inline void MemoryGroupBase<TensorType>::finalize_memory(TensorType *obj, void **handle, size_t size) +inline void MemoryGroupBase<TensorType>::finalize_memory(TensorType *obj, IMemory &obj_memory, size_t size) { // TODO (geopin01) : Check size (track size in MemoryMappings) // Check if existing mapping is valid - ARM_COMPUTE_ERROR_ON(!_mappings.empty() && (_mappings.find(handle) == std::end(_mappings))); + ARM_COMPUTE_ERROR_ON(!_mappings.empty() && (_mappings.find(&obj_memory) == std::end(_mappings))); if(_memory_manager && _mappings.empty()) { ARM_COMPUTE_ERROR_ON(!_memory_manager->lifetime_manager()); - _memory_manager->lifetime_manager()->end_lifetime(obj, handle, size); + _memory_manager->lifetime_manager()->end_lifetime(obj, obj_memory, size); } } |