diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-04-03 15:11:16 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-04-09 16:51:03 +0000 |
commit | 4d0351cf322df51baa5a445f637008992aa37809 (patch) | |
tree | 411e748a6bb5b64920780382e0613596dcd55ccf /arm_compute | |
parent | a4bba9c594c4022c9f85192bb8fd3593ad1a8d3c (diff) | |
download | ComputeLibrary-4d0351cf322df51baa5a445f637008992aa37809.tar.gz |
COMPMID-2057: Implement and test import memory interfaces.
Change-Id: I1559bea47ae6403177d248e2f7be47d5f1a6513f
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/956
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/core/CL/OpenCL.h | 5 | ||||
-rw-r--r-- | arm_compute/runtime/CL/CLTensorAllocator.h | 14 | ||||
-rw-r--r-- | arm_compute/runtime/TensorAllocator.h | 13 |
3 files changed, 22 insertions, 10 deletions
diff --git a/arm_compute/core/CL/OpenCL.h b/arm_compute/core/CL/OpenCL.h index 65cbb3282b..fc7083d276 100644 --- a/arm_compute/core/CL/OpenCL.h +++ b/arm_compute/core/CL/OpenCL.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -131,6 +131,9 @@ public: DECLARE_FUNCTION_PTR(clEnqueueMarker); DECLARE_FUNCTION_PTR(clWaitForEvents); + // Third-party extensions + DECLARE_FUNCTION_PTR(clImportMemoryARM); + #undef DECLARE_FUNCTION_PTR private: diff --git a/arm_compute/runtime/CL/CLTensorAllocator.h b/arm_compute/runtime/CL/CLTensorAllocator.h index de5f482d05..302bd6d52a 100644 --- a/arm_compute/runtime/CL/CLTensorAllocator.h +++ b/arm_compute/runtime/CL/CLTensorAllocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -103,13 +103,17 @@ public: void free() override; /** Import an existing memory as a tensor's backing memory * - * @warning ownership of memory is not transferred + * @warning memory should have been created under the same context that ACL 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. + * @note buffer size will be checked to be compliant with total_size reported by ITensorInfo. * - * @param[in] buffer Buffer to import + * @param[in] buffer Buffer to be used as backing memory * - * @return error status + * @return An error status */ - arm_compute::Status import_memory(cl::Buffer buffer); + Status import_memory(cl::Buffer buffer); /** Associates the tensor with a memory group * * @param[in] associated_memory_group Memory group to associate the tensor with diff --git a/arm_compute/runtime/TensorAllocator.h b/arm_compute/runtime/TensorAllocator.h index ba9e5163ab..f296bc2e3d 100644 --- a/arm_compute/runtime/TensorAllocator.h +++ b/arm_compute/runtime/TensorAllocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -95,11 +95,16 @@ public: void free() override; /** Import an existing memory as a tensor's backing memory * - * @warning ownership of memory is not transferred + * @warning size is expected to be compliant with total_size reported by ITensorInfo. + * @warning ownership of memory is not transferred. + * @warning tensor shouldn't be memory managed. + * @note buffer alignment will be checked to be compliant with alignment reported by ITensorInfo. * - * @return error status + * @param[in] memory Raw memory pointer to be used as backing memory + * + * @return An error status */ - arm_compute::Status import_memory(void *memory, size_t size); + Status import_memory(void *memory); /** Associates the tensor with a memory group * * @param[in] associated_memory_group Memory group to associate the tensor with |