diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2023-01-21 20:28:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-21 20:28:32 +0100 |
commit | e72f87ae5eca5e2ea8aea4f2ce49408c1faa0521 (patch) | |
tree | 588a426b6350a5c982d89d98749ae78667fd23b4 /src/kernels/levelx | |
parent | 03cffa83c5f7742f8ec0c5e762bb7048e38952f3 (diff) | |
parent | 73f49e9b3d4abc4214122e4b8c07a736e01626ee (diff) |
Merge pull request #451 from CodeLinaro/master
CLBlast modifications to address Qualcomm Adreno performance
Diffstat (limited to 'src/kernels/levelx')
-rw-r--r-- | src/kernels/levelx/col2im.opencl | 12 | ||||
-rw-r--r-- | src/kernels/levelx/im2col.opencl | 12 | ||||
-rw-r--r-- | src/kernels/levelx/xconvgemm_part2.opencl | 18 |
3 files changed, 35 insertions, 7 deletions
diff --git a/src/kernels/levelx/col2im.opencl b/src/kernels/levelx/col2im.opencl index 425ffbbc..ab0ffbfa 100644 --- a/src/kernels/levelx/col2im.opencl +++ b/src/kernels/levelx/col2im.opencl @@ -92,7 +92,11 @@ INLINE_FUNC void Xcol2im(const int input_h, const int input_w, const int channel // ================================================================================================= // Kernel flip version of the Xcol2im kernel (for convolution) -__kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#if RELAX_WORKGROUP_SIZE == 1 + __kernel +#else + __kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#endif void Xcol2imKernelFlip(const int input_h, const int input_w, const int channels, const int output_h, const int output_w, const int kernel_h, const int kernel_w, @@ -113,7 +117,11 @@ void Xcol2imKernelFlip(const int input_h, const int input_w, const int channels, } // Normal version of the Xcol2im kernel (for cross-correlation) -__kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#if RELAX_WORKGROUP_SIZE == 1 + __kernel +#else + __kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#endif void Xcol2imKernelNormal(const int input_h, const int input_w, const int channels, const int output_h, const int output_w, const int kernel_h, const int kernel_w, diff --git a/src/kernels/levelx/im2col.opencl b/src/kernels/levelx/im2col.opencl index 5db4cb5f..59af38fc 100644 --- a/src/kernels/levelx/im2col.opencl +++ b/src/kernels/levelx/im2col.opencl @@ -74,7 +74,11 @@ INLINE_FUNC void Xim2col(const int input_h, const int input_w, const int channel // ================================================================================================= // Kernel flip version of the Xim2col kernel (for convolution) -__kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#if RELAX_WORKGROUP_SIZE == 1 + __kernel +#else + __kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#endif void Xim2colKernelFlip(const int input_h, const int input_w, const int channels, const int output_h, const int output_w, const int kernel_h, const int kernel_w, @@ -91,7 +95,11 @@ void Xim2colKernelFlip(const int input_h, const int input_w, const int channels, } // Normal version of the Xim2col kernel (for cross-correlation) -__kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#if RELAX_WORKGROUP_SIZE == 1 + __kernel +#else + __kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) +#endif void Xim2colKernelNormal(const int input_h, const int input_w, const int channels, const int output_h, const int output_w, const int kernel_h, const int kernel_w, diff --git a/src/kernels/levelx/xconvgemm_part2.opencl b/src/kernels/levelx/xconvgemm_part2.opencl index 693cb120..38ddd7eb 100644 --- a/src/kernels/levelx/xconvgemm_part2.opencl +++ b/src/kernels/levelx/xconvgemm_part2.opencl @@ -23,7 +23,11 @@ R"( // ConvGEMM kernel #if defined(CONVGEMM_WITH_IM2COL) -__kernel __attribute__((reqd_work_group_size(MDIMCD, NDIMCD, 1))) +#if RELAX_WORKGROUP_SIZE == 1 + __kernel +#else + __kernel __attribute__((reqd_work_group_size(MDIMCD, NDIMCD, 1))) +#endif void Xconvgemm(const int num_patches, const int num_kernels, const int patch_size, const __global realND* restrict kernelgm, const int kernel_offset, __global real* resultgm, const int result_offset, const int result_stride, @@ -285,7 +289,11 @@ INLINE_FUNC void Xconvgemm(const int num_patches, const int num_kernels, const i } #if !defined(CONVGEMM_WITH_IM2COL) -__kernel __attribute__((reqd_work_group_size(MDIMCD, NDIMCD, 1))) +#if RELAX_WORKGROUP_SIZE == 1 + __kernel +#else + __kernel __attribute__((reqd_work_group_size(MDIMCD, NDIMCD, 1))) +#endif void XconvgemmFlip(const int num_patches, const int num_kernels, const int patch_size, const __global realND* restrict kernelgm, const int kernel_offset, __global real* resultgm, const int result_offset, const int result_stride, @@ -306,7 +314,11 @@ void XconvgemmFlip(const int num_patches, const int num_kernels, const int patch output_h, output_w, alm, blm, kernel_flip); } -__kernel __attribute__((reqd_work_group_size(MDIMCD, NDIMCD, 1))) +#if RELAX_WORKGROUP_SIZE == 1 + __kernel +#else + __kernel __attribute__((reqd_work_group_size(MDIMCD, NDIMCD, 1))) +#endif void XconvgemmNormal(const int num_patches, const int num_kernels, const int patch_size, const __global realND* restrict kernelgm, const int kernel_offset, __global real* resultgm, const int result_offset, const int result_stride, |