aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-11-14 13:16:56 +0000
committerIsabella Gottardi <isabella.gottardi@arm.com>2018-11-21 09:52:04 +0000
commitdf3103622b7de05f4e35b22a2c94b4a46eab4efc (patch)
tree17e10253e7a069c69d10bea0882b699b99d74b86 /arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h
parentc47ef20d69e8ea0f519fdc679435cd7037fc18fe (diff)
downloadComputeLibrary-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/GLES_COMPUTE/GCTensorAllocator.h')
-rw-r--r--arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h28
1 files changed, 7 insertions, 21 deletions
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 <typename>
class MemoryGroupBase;
using GCMemoryGroup = MemoryGroupBase<GCTensor>;
-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<GLBufferWrapper> _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__ */