diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-09-09 19:00:57 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-09-17 11:37:02 +0000 |
commit | 26014cf4d0519aef280c8444c60ec34c4e37e3b6 (patch) | |
tree | 7f4b3cb8589c10e95288a722498c9256e8bf5e22 /src/runtime/GLES_COMPUTE | |
parent | caa7deedfe1b0d0020c6099d8f616ec92b1bd5e9 (diff) | |
download | ComputeLibrary-26014cf4d0519aef280c8444c60ec34c4e37e3b6.tar.gz |
COMPMID-2649: Generalize MemoryGroup.
Avoids any upcasting.
Change-Id: I2181c7c9df59a7fb8a78e11934fbd96058fd39c7
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/1918
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'src/runtime/GLES_COMPUTE')
-rw-r--r-- | src/runtime/GLES_COMPUTE/GCTensor.cpp | 14 | ||||
-rw-r--r-- | src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp | 8 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/runtime/GLES_COMPUTE/GCTensor.cpp b/src/runtime/GLES_COMPUTE/GCTensor.cpp index e193d26f0a..66c1abdb6d 100644 --- a/src/runtime/GLES_COMPUTE/GCTensor.cpp +++ b/src/runtime/GLES_COMPUTE/GCTensor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -24,8 +24,8 @@ #include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" -using namespace arm_compute; - +namespace arm_compute +{ GCTensor::GCTensor() : _allocator(this) { @@ -56,6 +56,11 @@ GLuint GCTensor::gc_buffer() const return _allocator.get_gl_ssbo_name(); } +void GCTensor::associate_memory_group(arm_compute::IMemoryGroup *memory_group) +{ + _allocator.set_associated_memory_group(memory_group); +} + void GCTensor::map(bool blocking) { IGCTensor::map(blocking); @@ -74,4 +79,5 @@ uint8_t *GCTensor::do_map(bool blocking) void GCTensor::do_unmap() { _allocator.unmap(); -}
\ No newline at end of file +} +} // namespace arm_compute
\ No newline at end of file diff --git a/src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp b/src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp index 9a5d139517..cccc6a75c6 100644 --- a/src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp +++ b/src/runtime/GLES_COMPUTE/GCTensorAllocator.cpp @@ -32,8 +32,8 @@ using namespace arm_compute; -GCTensorAllocator::GCTensorAllocator(GCTensor *owner) - : _associated_memory_group(nullptr), _memory(), _mapping(nullptr), _owner(owner) +GCTensorAllocator::GCTensorAllocator(IMemoryManageable *owner) + : _owner(owner), _associated_memory_group(nullptr), _memory(), _mapping(nullptr) { } @@ -50,7 +50,7 @@ void GCTensorAllocator::allocate() } else { - _associated_memory_group->finalize_memory(_owner, _memory, info().total_size()); + _associated_memory_group->finalize_memory(_owner, _memory, info().total_size(), alignment()); } info().set_is_resizable(false); } @@ -62,7 +62,7 @@ void GCTensorAllocator::free() info().set_is_resizable(true); } -void GCTensorAllocator::set_associated_memory_group(GCMemoryGroup *associated_memory_group) +void GCTensorAllocator::set_associated_memory_group(IMemoryGroup *associated_memory_group) { ARM_COMPUTE_ERROR_ON(associated_memory_group == nullptr); ARM_COMPUTE_ERROR_ON(_associated_memory_group != nullptr && _associated_memory_group != associated_memory_group); |