diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-04-13 19:44:17 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-04-14 14:37:44 +0000 |
commit | 035004e65dbffb6534ad4183cf8f95da0544fd28 (patch) | |
tree | 6ba1c45e6fc39c27672448cd5f5ed7e86cd61eed /arm_compute | |
parent | 327225d3b2f716d5c62d801a7fafc7d377521f34 (diff) | |
download | ComputeLibrary-035004e65dbffb6534ad4183cf8f95da0544fd28.tar.gz |
Add support for a global allocator for OpenCL tensors
Give the ability to the user to specify an allocator that can be used by
all the internal function tensors. This being a global needs to outlive
all the tensors/functions that are using it.
Resolves: COMPMID-4212, COMPMID-4213
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I251871c242879976819ebca1452404133a8e62d7
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5420
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/runtime/CL/CLTensorAllocator.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arm_compute/runtime/CL/CLTensorAllocator.h b/arm_compute/runtime/CL/CLTensorAllocator.h index 067c391489..1b061ee1d6 100644 --- a/arm_compute/runtime/CL/CLTensorAllocator.h +++ b/arm_compute/runtime/CL/CLTensorAllocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,6 +26,7 @@ #include "arm_compute/runtime/CL/CLArray.h" #include "arm_compute/runtime/CL/CLMemory.h" +#include "arm_compute/runtime/IAllocator.h" #include "arm_compute/runtime/ITensorAllocator.h" #include "arm_compute/runtime/MemoryGroup.h" @@ -127,6 +128,13 @@ public: */ void set_associated_memory_group(IMemoryGroup *associated_memory_group); + /** Sets global allocator that will be used by all CLTensor objects + * + * + * @param[in] allocator Allocator to be used as a global allocator + */ + static void set_global_allocator(IAllocator *allocator); + protected: /** Call map() on the OpenCL buffer. * |