| 461 | } |
| 462 | |
| 463 | static int |
| 464 | getDefaultDecomposition( |
| 465 | PGranularity *pgran, |
| 466 | SubproblemDim *subdims, |
| 467 | unsigned int subdimsNum, |
| 468 | void *pArgs) |
| 469 | { |
| 470 | |
| 471 | DUMMY_ARG_USAGE(pArgs); |
| 472 | // |
| 473 | // FIXME: container_of() - Counts on the fact that "getDefaultDecomposition" is called |
| 474 | // with step->pgran, step->subdims |
| 475 | // |
| 476 | SolutionStep *step = container_of( pgran , pgran, SolutionStep); |
| 477 | |
| 478 | blockSizes bestSize = bestBlockSizeForDevice( step ); |
| 479 | |
| 480 | pgran->wgSize[0] = bestSize.TY * bestSize.TX; |
| 481 | pgran->wgSize[1] = 1; |
| 482 | pgran->wgDim = 1; |
| 483 | |
| 484 | if (subdimsNum >= 1) |
| 485 | { |
| 486 | subdims[0].y = bestSize.TY * bestSize.ITEMY; |
| 487 | subdims[0].x = bestSize.TX * bestSize.ITEMX; |
| 488 | subdims[0].itemY = bestSize.ITEMY; |
| 489 | subdims[0].itemX = bestSize.ITEMX; |
| 490 | subdims[0].bwidth = 4; |
| 491 | } |
| 492 | if (subdimsNum >= 2) |
| 493 | { |
| 494 | subdims[1].y = bestSize.TY * bestSize.ITEMY; |
| 495 | subdims[1].x = bestSize.TX * bestSize.ITEMX; |
| 496 | subdims[1].itemY = bestSize.ITEMY; |
| 497 | subdims[1].itemX = bestSize.ITEMX; |
| 498 | subdims[1].bwidth = 4; |
| 499 | } |
| 500 | |
| 501 | return 0; |
| 502 | } |
| 503 |
nothing calls this directly
no test coverage detected