diff options
Diffstat (limited to 'arm_compute/AclOpenClExt.h')
-rw-r--r-- | arm_compute/AclOpenClExt.h | 66 |
1 files changed, 55 insertions, 11 deletions
diff --git a/arm_compute/AclOpenClExt.h b/arm_compute/AclOpenClExt.h index f71cd37299..28e918d371 100644 --- a/arm_compute/AclOpenClExt.h +++ b/arm_compute/AclOpenClExt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. + * Copyright (c) 2021-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -21,13 +21,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_ACLOPENCLEXT_H_ -#define ARM_COMPUTE_ACLOPENCLEXT_H_ +#ifndef ARM_COMPUTE_ACL_OPENCL_EXT_H_ +#define ARM_COMPUTE_ACL_OPENCL_EXT_H_ #include "arm_compute/AclTypes.h" #ifndef CL_TARGET_OPENCL_VERSION -#define CL_TARGET_OPENCL_VERSION 200 +#define CL_TARGET_OPENCL_VERSION 300 #define CL_USE_DEPRECATED_OPENCL_1_1_APIS #define CL_USE_DEPRECATED_OPENCL_1_2_APIS #endif /* CL_TARGET_OPENCL_VERSION */ @@ -37,22 +37,33 @@ #pragma GCC diagnostic pop #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* __cplusplus */ -/** Extract the underlying OpenCL context used by a given Compute Library context object + /** Extract the underlying OpenCL context used by a given Compute Library context object * * @note @ref AclContext should be of an OpenCL backend target - * @note @ref AclContext refcount should be 0, meaning not used by other objects * * @param[in] ctx A valid non-zero context * @param[out] opencl_context Underlying OpenCL context used * * @return Status code */ -AclStatus AclGetClContext(AclContext ctx, cl_context *opencl_context); + AclStatus AclGetClContext(AclContext ctx, cl_context *opencl_context); -/** Set the underlying OpenCL context used by a given Compute Library context object + /** Extract the underlying OpenCL device id used by a given Compute Library context object + * + * @note @ref AclContext should be of an OpenCL backend target + * + * @param[in] ctx A valid non-zero context + * @param[out] opencl_device Underlying OpenCL device used + * + * @return Status code + */ + AclStatus AclGetClDevice(AclContext ctx, cl_device_id *opencl_device); + + /** Set the underlying OpenCL context to be used by a given Compute Library context object * * @note @ref AclContext should be of an OpenCL backend target * @@ -61,9 +72,42 @@ AclStatus AclGetClContext(AclContext ctx, cl_context *opencl_context); * * @return Status code */ -AclStatus AclSetClContext(AclContext ctx, cl_context opencl_context); + AclStatus AclSetClContext(AclContext ctx, cl_context opencl_context); + + /** Extract the underlying OpenCL queue used by a given Compute Library queue object + * + * @note @ref AclQueue should be of an OpenCL backend target + * @note @ref AclQueue refcount should be 0, meaning not used by other objects + * + * @param[in] queue A valid non-zero queue + * @param[out] opencl_queue Underlying OpenCL queue used + * + * @return Status code + */ + AclStatus AclGetClQueue(AclQueue queue, cl_command_queue *opencl_queue); + + /** Set the underlying OpenCL queue to be used by a given Compute Library queue object + * + * @note @ref AclQueue should be of an OpenCL backend target + * @note opecl_queue needs to be created from the same context that the AclContext that the queue will use + * + * @param[in] queue A valid non-zero queue object + * @param[out] opencl_queue Underlying OpenCL queue to be used + * + * @return Status code + */ + AclStatus AclSetClQueue(AclQueue queue, cl_command_queue opencl_queue); + + /** Extract the underlying OpenCL memory object by a given Compute Library tensor object + * + * @param[in] tensor A valid non-zero tensor + * @param[out] opencl_mem Underlyig OpenCL memory object + * + * @return Status code + */ + AclStatus AclGetClMem(AclTensor tensor, cl_mem *opencl_mem); #ifdef __cplusplus } #endif /* __cplusplus */ -#endif /* ARM_COMPUTE_ACLOPENCLEXT_H_ */ +#endif /* ARM_COMPUTE_ACL_OPENCL_EXT_H_ */ |