diff options
Diffstat (limited to 'libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h')
-rw-r--r-- | libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h b/libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h index 8143d2398..0e123ae0a 100644 --- a/libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h +++ b/libs/ARMComputeEx/src/core/CL/cl_kernels/helpers.h @@ -24,15 +24,23 @@ #ifndef ARM_COMPUTE_HELPER_H #define ARM_COMPUTE_HELPER_H -#if defined(ARM_COMPUTE_OPENCL_FP16_ENABLED) +#if defined(ARM_COMPUTE_OPENCL_FP16_ENABLED) && defined(cl_khr_fp16) #pragma OPENCL EXTENSION cl_khr_fp16 : enable -#endif // defined(ARM_COMPUTE_OPENCL_FP16_ENABLED) +#endif // defined(ARM_COMPUTE_OPENCL_FP16_ENABLED) && defined(cl_khr_fp16) -#if defined(ARM_COMPUTE_DEBUG_ENABLED) -#if defined(cl_arm_printf) +#if defined(ARM_COMPUTE_OPENCL_DOT8_ENABLED) && defined(cl_arm_integer_dot_product_int8) +#pragma OPENCL EXTENSION cl_arm_integer_dot_product_int8 : enable +#endif // defined(ARM_COMPUTE_OPENCL_DOT8_ENABLED) && defined(cl_arm_integer_dot_product_int8) + +#if defined(ARM_COMPUTE_OPENCL_DOT8_ACC_ENABLED) && \ + defined(cl_arm_integer_dot_product_accumulate_int8) +#pragma OPENCL EXTENSION cl_arm_integer_dot_product_accumulate_int8 : enable +#endif // defined(ARM_COMPUTE_OPENCL_DOT8_ACC_ENABLED) && + // defined(cl_arm_integer_dot_product_accumulate_int8) + +#if defined(ARM_COMPUTE_DEBUG_ENABLED) && defined(cl_arm_printf) #pragma OPENCL EXTENSION cl_arm_printf : enable -#endif // defined(cl_arm_printf) -#endif // defined(ARM_COMPUTE_DEBUG_ENABLED) +#endif // defined(ARM_COMPUTE_DEBUG_ENABLED) && defined(cl_arm_printf) #define EXPAND(x) x @@ -175,7 +183,7 @@ typedef struct Tensor4D * * @return An image object */ -Vector inline update_vector_workitem_ptr(__global uchar *ptr, uint offset_first_element_in_bytes, +inline Vector update_vector_workitem_ptr(__global uchar *ptr, uint offset_first_element_in_bytes, uint stride_x, uint step_x) { Vector vector = { @@ -201,7 +209,7 @@ Vector inline update_vector_workitem_ptr(__global uchar *ptr, uint offset_first_ * * @return An image object */ -Image inline update_image_workitem_ptr(__global uchar *ptr, uint offset_first_element_in_bytes, +inline Image update_image_workitem_ptr(__global uchar *ptr, uint offset_first_element_in_bytes, uint stride_x, uint step_x, uint stride_y, uint step_y) { Image img = {.ptr = ptr, @@ -230,7 +238,7 @@ Image inline update_image_workitem_ptr(__global uchar *ptr, uint offset_first_el * * @return A 3D tensor object */ -Image inline update_image_from_tensor3D_workitem_ptr(__global uchar *ptr, +inline Image update_image_from_tensor3D_workitem_ptr(__global uchar *ptr, uint offset_first_element_in_bytes, uint stride_x, uint step_x, uint stride_y, uint step_y, uint stride_z, uint step_z) @@ -261,7 +269,7 @@ Image inline update_image_from_tensor3D_workitem_ptr(__global uchar *ptr, * * @return A 3D tensor object */ -Tensor3D inline update_tensor3D_workitem_ptr(__global uchar *ptr, +inline Tensor3D update_tensor3D_workitem_ptr(__global uchar *ptr, uint offset_first_element_in_bytes, uint stride_x, uint step_x, uint stride_y, uint step_y, uint stride_z, uint step_z) @@ -276,7 +284,7 @@ Tensor3D inline update_tensor3D_workitem_ptr(__global uchar *ptr, return tensor; } -Tensor4D inline update_tensor4D_workitem_ptr(__global uchar *ptr, +inline Tensor4D update_tensor4D_workitem_ptr(__global uchar *ptr, uint offset_first_element_in_bytes, uint stride_x, uint step_x, uint stride_y, uint step_y, uint stride_z, uint step_z, uint stride_w, uint step_w, uint mod_size) @@ -299,7 +307,7 @@ Tensor4D inline update_tensor4D_workitem_ptr(__global uchar *ptr, * @param[in] vec Pointer to the starting position of the buffer * @param[in] x Relative X position */ -__global inline const uchar *vector_offset(const Vector *vec, int x) +inline __global const uchar *vector_offset(const Vector *vec, int x) { return vec->ptr + x * vec->stride_x; } @@ -310,7 +318,7 @@ __global inline const uchar *vector_offset(const Vector *vec, int x) * @param[in] x Relative X position * @param[in] y Relative Y position */ -__global inline uchar *offset(const Image *img, int x, int y) +inline __global uchar *offset(const Image *img, int x, int y) { return img->ptr + x * img->stride_x + y * img->stride_y; } @@ -322,7 +330,7 @@ __global inline uchar *offset(const Image *img, int x, int y) * @param[in] y Relative Y position * @param[in] z Relative Z position */ -__global inline const uchar *tensor3D_offset(const Tensor3D *tensor, int x, int y, int z) +inline __global const uchar *tensor3D_offset(const Tensor3D *tensor, int x, int y, int z) { return tensor->ptr + x * tensor->stride_x + y * tensor->stride_y + z * tensor->stride_z; } @@ -335,7 +343,7 @@ __global inline const uchar *tensor3D_offset(const Tensor3D *tensor, int x, int * @param[in] z Relative Z position * @param[in] w Relative W position */ -__global inline const uchar *tensor4D_offset(const Tensor4D *tensor, int x, int y, int z, int w) +inline __global const uchar *tensor4D_offset(const Tensor4D *tensor, int x, int y, int z, int w) { return tensor->ptr + x * tensor->stride_x + y * tensor->stride_y + z * tensor->stride_z + w * tensor->stride_w; |