aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/CLTensorAllocator.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-13 19:44:17 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-04-14 14:37:44 +0000
commit035004e65dbffb6534ad4183cf8f95da0544fd28 (patch)
tree6ba1c45e6fc39c27672448cd5f5ed7e86cd61eed /arm_compute/runtime/CL/CLTensorAllocator.h
parent327225d3b2f716d5c62d801a7fafc7d377521f34 (diff)
downloadComputeLibrary-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/runtime/CL/CLTensorAllocator.h')
-rw-r--r--arm_compute/runtime/CL/CLTensorAllocator.h10
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.
*