MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / globalWorkSize

Method globalWorkSize

src/library/tools/ktest/step.cpp:618–664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

616}
617
618std::string
619Step::globalWorkSize()
620{
621 size_t globalWorkSize[MAX_WORK_DIM] = { 0, 0, 0 };
622 std::stringstream ss;
623 SubproblemDim dims[MAX_SUBDIMS];
624
625 memcpy(dims, step_.subdims, sizeof(dims));
626
627 if (pattern_->sops->calcThreads) {
628 pattern_->sops->calcThreads(globalWorkSize, step_.subdims,
629 &step_.pgran, &step_.args, &kextra_);
630 }
631 else {
632 SubproblemDim globDim;
633 const PGranularity *pg;
634
635 pg = (pattern_->nrLevels == 1) ? NULL : &step_.pgran;
636 kargsToProbDims(&globDim, blasFunctionID(), &step_.args, false);
637
638 // fixup dimensions in respect with desired work dispatch order
639 if ((pgran().wgDim == 2) && pattern_->sops->innerDecompositionAxis) {
640 if (pattern_->sops->innerDecompositionAxis(&step_.args) ==
641 DECOMP_AXIS_X) {
642
643 /*
644 * these dimensions will not be used more anywhere, so we can
645 * just swap them
646 */
647 swapDimXY(&dims[0]);
648 swapDimXY(&dims[1]);
649 swapDimXY(&globDim);
650 }
651 }
652
653 calcGlobalThreads(globalWorkSize, dims, pg, globDim.y, globDim.x);
654 }
655
656 for (unsigned int i = 0; i < pgran().wgDim; i++) {
657 if (i != 0) {
658 ss << ", ";
659 }
660 ss << globalWorkSize[i];
661 }
662
663 return ss.str();
664}
665
666void
667Step::setKernelName(std::string name)

Callers 1

declareGranulationMethod · 0.80

Calls 3

kargsToProbDimsFunction · 0.85
swapDimXYFunction · 0.85
calcGlobalThreadsFunction · 0.85

Tested by 1

declareGranulationMethod · 0.64