| 337 | |
| 338 | |
| 339 | clfftStatus FFTGeneratedTransposeNonSquareAction::getWorkSizes(std::vector< size_t >& globalWS, std::vector< size_t >& localWS) |
| 340 | { |
| 341 | |
| 342 | size_t wg_slice; |
| 343 | size_t smaller_dim = (this->signature.fft_N[0] < this->signature.fft_N[1]) ? this->signature.fft_N[0] : this->signature.fft_N[1]; |
| 344 | size_t bigger_dim = (this->signature.fft_N[0] >= this->signature.fft_N[1]) ? this->signature.fft_N[0] : this->signature.fft_N[1]; |
| 345 | size_t dim_ratio = bigger_dim / smaller_dim; |
| 346 | size_t global_item_size; |
| 347 | |
| 348 | if (this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED_LEADING) |
| 349 | { |
| 350 | if (smaller_dim % (16 * reShapeFactor) == 0) |
| 351 | wg_slice = smaller_dim / 16 / reShapeFactor; |
| 352 | else |
| 353 | wg_slice = (smaller_dim / (16 * reShapeFactor)) + 1; |
| 354 | |
| 355 | global_item_size = wg_slice*(wg_slice + 1) / 2 * 16 * 16 * this->plan->batchsize; |
| 356 | |
| 357 | for (int i = 2; i < this->signature.fft_DataDim - 1; i++) |
| 358 | { |
| 359 | global_item_size *= this->signature.fft_N[i]; |
| 360 | } |
| 361 | |
| 362 | /*Push the data required for the transpose kernels*/ |
| 363 | globalWS.clear(); |
| 364 | if(this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED_LEADING) |
| 365 | globalWS.push_back(global_item_size * dim_ratio); |
| 366 | else if (this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED) |
| 367 | globalWS.push_back(global_item_size); |
| 368 | |
| 369 | |
| 370 | localWS.clear(); |
| 371 | localWS.push_back(lwSize); |
| 372 | } |
| 373 | else if (this->signature.nonSquareKernelType == NON_SQUARE_TRANS_TRANSPOSE_BATCHED) |
| 374 | { |
| 375 | if (smaller_dim % (16 * reShapeFactor) == 0) |
| 376 | wg_slice = smaller_dim / 16 / reShapeFactor; |
| 377 | else |
| 378 | wg_slice = (smaller_dim / (16 * reShapeFactor)) + 1; |
| 379 | |
| 380 | global_item_size = wg_slice*(wg_slice + 1) / 2 * 16 * 16 * this->plan->batchsize; |
| 381 | |
| 382 | for (int i = 2; i < this->plan->length.size(); i++) |
| 383 | { |
| 384 | global_item_size *= this->plan->length[i]; |
| 385 | } |
| 386 | |
| 387 | /*Push the data required for the transpose kernels*/ |
| 388 | globalWS.clear(); |
| 389 | globalWS.push_back(global_item_size); |
| 390 | |
| 391 | |
| 392 | localWS.clear(); |
| 393 | localWS.push_back(lwSize); |
| 394 | } |
| 395 | else |
| 396 | { |
nothing calls this directly
no test coverage detected