| 176 | } |
| 177 | |
| 178 | static void |
| 179 | calcNrThreads( |
| 180 | size_t threads[2], |
| 181 | const SubproblemDim *subdims, |
| 182 | const PGranularity *pgran, |
| 183 | const void *args, |
| 184 | const void *_extra) |
| 185 | { |
| 186 | const CLBlasKargs *kargs = (const CLBlasKargs *)args; |
| 187 | const CLBLASKernExtra *extra = ( CLBLASKernExtra *)_extra; |
| 188 | size_t BLOCKSIZE = pgran->wgSize[0] * pgran->wgSize[1]; // 1D Block |
| 189 | size_t BH, BW; |
| 190 | unsigned int VEC_LEN = extra->vecLenA; |
| 191 | |
| 192 | clblasOrder order = ( extra->flags & KEXTRA_COLUMN_MAJOR) ? clblasColumnMajor: clblasRowMajor; |
| 193 | |
| 194 | size_t nBlocksY; //number of blocks in Y dir ( Although we say 1D block to opencl ) |
| 195 | size_t nBlocksX; //number of blocks in X dir |
| 196 | |
| 197 | BH = subdims->y; |
| 198 | BW = subdims->x; |
| 199 | |
| 200 | if ( order == clblasColumnMajor ) |
| 201 | { |
| 202 | nBlocksY = ( kargs->M + BH*VEC_LEN - 1 ) / (BH*VEC_LEN); |
| 203 | nBlocksX = ( kargs->N + BW - 1) / BW; |
| 204 | } |
| 205 | else |
| 206 | { |
| 207 | nBlocksY = ( kargs->M + BH - 1) / BH; |
| 208 | nBlocksX = ( kargs->N + BW*VEC_LEN - 1) / (BW*VEC_LEN); |
| 209 | } |
| 210 | size_t blocks = nBlocksX * nBlocksY; |
| 211 | threads[0] = blocks * BLOCKSIZE; |
| 212 | threads[1] = 1; |
| 213 | |
| 214 | #ifdef DEBUG_GER |
| 215 | printf("calcNrThreads called from GER_Reg.cpp.. wgSize[0]: %u\twgSize[1]: %u\n", pgran->wgSize[0], pgran->wgSize[1]); |
| 216 | printf("subdim->y :%u\t subdim->x : %u\n", subdims->y, subdims->x); |
| 217 | printf("kargs-> M : %d, kargs-> N: %d, BH: %d, BW: %d\n", kargs->M, kargs->N, BH, BW); |
| 218 | printf("blocks : %d\tglobalthreads[0] : %u\t VecLen :%d\n", blocks, threads[0], VEC_LEN); |
| 219 | #endif |
| 220 | |
| 221 | } |
| 222 | |
| 223 | // |
| 224 | // FIXME: Report correct return value - Needs change in KPRINTF |
nothing calls this directly
no outgoing calls
no test coverage detected