diff options
Diffstat (limited to 'arm_compute/runtime/CL/CLTensorAllocator.h')
-rw-r--r-- | arm_compute/runtime/CL/CLTensorAllocator.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arm_compute/runtime/CL/CLTensorAllocator.h b/arm_compute/runtime/CL/CLTensorAllocator.h index 7c1bc03486..fde8e9c43a 100644 --- a/arm_compute/runtime/CL/CLTensorAllocator.h +++ b/arm_compute/runtime/CL/CLTensorAllocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2019 ARM Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,14 +24,14 @@ #ifndef ARM_COMPUTE_CLTENSORALLOCATOR_H #define ARM_COMPUTE_CLTENSORALLOCATOR_H +#include "arm_compute/core/CL/CLTypes.h" +#include "arm_compute/core/CL/OpenCL.h" #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" -#include "arm_compute/core/CL/CLTypes.h" -#include "arm_compute/core/CL/OpenCL.h" - #include <cstdint> namespace arm_compute @@ -108,7 +108,7 @@ public: void free() override; /** Import an existing memory as a tensor's backing memory * - * @warning memory should have been created under the same context that ACL uses. + * @warning memory should have been created under the same context that Compute Library uses. * @warning memory is expected to be aligned with the device requirements. * @warning tensor shouldn't be memory managed. * @warning ownership of memory is not transferred. @@ -127,6 +127,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. * @@ -140,7 +147,7 @@ private: static const cl::Buffer _empty_buffer; private: - CLRuntimeContext *_ctx; + CLRuntimeContext *_ctx; IMemoryManageable *_owner; /**< Memory manageable object that owns the allocator */ IMemoryGroup *_associated_memory_group; /**< Registered memory manager */ CLMemory _memory; /**< OpenCL memory */ |