From df3103622b7de05f4e35b22a2c94b4a46eab4efc Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 14 Nov 2018 13:16:56 +0000 Subject: COMPMID-1088: Use IMemoryRegion in interfaces where possible -Simplifies import memory interface -Changes the used of void** handles with appropriate interfaces. Change-Id: I5918c855c11f46352058864623336b352162a4b7 --- .../runtime/GLES_COMPUTE/GCTensorAllocator.h | 28 ++++++---------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h') diff --git a/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h b/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h index 1bd3582b6c..b7067664fc 100644 --- a/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h +++ b/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h @@ -26,6 +26,7 @@ #define __ARM_COMPUTE_GCTENSORALLOCATOR_H__ #include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" +#include "arm_compute/runtime/GLES_COMPUTE/GCMemory.h" #include "arm_compute/runtime/ITensorAllocator.h" #include "arm_compute/runtime/MemoryGroupBase.h" @@ -38,20 +39,6 @@ template class MemoryGroupBase; using GCMemoryGroup = MemoryGroupBase; -class GLBufferWrapper -{ -public: - GLBufferWrapper() - : _ssbo_name(0) - { - ARM_COMPUTE_GL_CHECK(glGenBuffers(1, &_ssbo_name)); - } - ~GLBufferWrapper() - { - ARM_COMPUTE_GL_CHECK(glDeleteBuffers(1, &_ssbo_name)); - } - GLuint _ssbo_name; -}; /** Basic implementation of a GLES memory tensor allocator. */ class GCTensorAllocator : public ITensorAllocator { @@ -72,7 +59,7 @@ public: GCTensorAllocator &operator=(GCTensorAllocator &&) = default; /** Default destructor */ - ~GCTensorAllocator(); + ~GCTensorAllocator() = default; /** Interface to be implemented by the child class to return the pointer to the mapped data. * @@ -135,11 +122,10 @@ protected: void unlock() override; private: - GCMemoryGroup *_associated_memory_group; /**< Registered memory group */ - std::unique_ptr _gl_buffer; /**< OpenGL ES object containing the tensor data. */ - uint8_t *_mapping; /**< Pointer to the CPU mapping of the OpenGL ES buffer. */ - GCTensor *_owner; /**< Owner of the allocator */ + GCMemoryGroup *_associated_memory_group; /**< Registered memory group */ + GCMemory _memory; /**< OpenGL ES memory */ + uint8_t *_mapping; /**< Pointer to the CPU mapping of the OpenGL ES buffer. */ + GCTensor *_owner; /**< Owner of the allocator */ }; -} - +} // namespace arm_compute #endif /* __ARM_COMPUTE_GCTENSORALLOCATOR_H__ */ -- cgit v1.2.1