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 /arm_compute/runtime/CL/CLTensorAllocator.h | |
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 'arm_compute/runtime/CL/CLTensorAllocator.h')
-rw-r--r-- | arm_compute/runtime/CL/CLTensorAllocator.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arm_compute/runtime/CL/CLTensorAllocator.h b/arm_compute/runtime/CL/CLTensorAllocator.h index f7800d39f8..3450c72d61 100644 --- a/arm_compute/runtime/CL/CLTensorAllocator.h +++ b/arm_compute/runtime/CL/CLTensorAllocator.h @@ -27,6 +27,7 @@ #include "arm_compute/runtime/CL/CLArray.h" #include "arm_compute/runtime/CL/CLMemory.h" #include "arm_compute/runtime/ITensorAllocator.h" +#include "arm_compute/runtime/MemoryGroup.h" #include "arm_compute/core/CL/CLTypes.h" #include "arm_compute/core/CL/OpenCL.h" @@ -36,10 +37,6 @@ namespace arm_compute { class CLTensor; -template <typename> -class MemoryGroupBase; -/** Memory Group in OpenCL */ -using CLMemoryGroup = MemoryGroupBase<CLTensor>; /** Basic implementation of a CL memory tensor allocator. */ class CLTensorAllocator : public ITensorAllocator @@ -49,7 +46,7 @@ public: * * @param[in] owner (Optional) Owner of the allocator. */ - CLTensorAllocator(CLTensor *owner = nullptr); + CLTensorAllocator(IMemoryManageable *owner = nullptr); /** Prevent instances of this class from being copied (As this class contains pointers) */ CLTensorAllocator(const CLTensorAllocator &) = delete; /** Prevent instances of this class from being copy assigned (As this class contains pointers) */ @@ -127,7 +124,7 @@ public: * * @param[in] associated_memory_group Memory group to associate the tensor with */ - void set_associated_memory_group(CLMemoryGroup *associated_memory_group); + void set_associated_memory_group(IMemoryGroup *associated_memory_group); protected: /** Call map() on the OpenCL buffer. @@ -142,12 +139,12 @@ private: static const cl::Buffer _empty_buffer; private: - CLMemoryGroup *_associated_memory_group; /**< Registered memory manager */ - CLMemory _memory; /**< OpenCL memory */ - uint8_t *_mapping; /**< Pointer to the CPU mapping of the OpenCL buffer. */ - CLTensor *_owner; /**< Owner of the allocator */ - CLFloatArray _scale; /**< Scales array in case of quantized per channel data type */ - CLInt32Array _offset; /**< Offsets array in case of quantized per channel data type */ + IMemoryManageable *_owner; /**< Memory manageable object that owns the allocator */ + IMemoryGroup *_associated_memory_group; /**< Registered memory manager */ + CLMemory _memory; /**< OpenCL memory */ + uint8_t *_mapping; /**< Pointer to the CPU mapping of the OpenCL buffer. */ + CLFloatArray _scale; /**< Scales array in case of quantized per channel data type */ + CLInt32Array _offset; /**< Offsets array in case of quantized per channel data type */ }; } // namespace arm_compute #endif /* __ARM_COMPUTE_CLTENSORALLOCATOR_H__ */ |