// ================================================================================================= // This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This // project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max- // width of 100 characters per line. // // Author(s): // Cedric Nugteren // // This file contains the common kernels shared among different BLAS routines. This file contains // kernels to copy matrices. // // ================================================================================================= // Enables loading of this file using the C++ pre-processor's #include (C++11 standard raw string // literal). Comment-out this line for syntax-highlighting when developing. R"( // ================================================================================================= // Data-widths #if COPY_VW == 1 typedef real realC; #elif COPY_VW == 2 typedef real2 realC; #elif COPY_VW == 4 typedef real4 realC; #elif COPY_VW == 8 typedef real8 realC; #elif COPY_VW == 16 typedef real16 realC; #endif // ================================================================================================= // Fast copy kernel. Requires 'ld' and the number of threads in dimension 0 to be a multiple of // COPY_VW. Also requires both matrices to be of the same dimensions and without offset. __kernel __attribute__((reqd_work_group_size(COPY_DIMX, COPY_DIMY, 1))) void CopyMatrixFast(const int ld, __global const realC* restrict src, __global realC* dest, const real_arg arg_alpha) { const real alpha = GetRealArg(arg_alpha); #pragma unroll for (int w_one=0; w_one