Lines Matching refs:mtls
518 // dimensions into the mtls start/end fields.
526 bool RsdCpuScriptImpl::setUpMtlsDimensions(MTLaunchStructCommon *mtls,
529 rsAssert(mtls);
533 mtls->end.DIM_FIELD = baseDim.DIM_FIELD; \
535 mtls->start.DIM_FIELD = \
537 mtls->end.DIM_FIELD = \
539 if (mtls->start.DIM_FIELD >= mtls->end.DIM_FIELD) { \
562 MTLaunchStructReduce *mtls) {
564 memset(mtls, 0, sizeof(MTLaunchStructReduce));
565 mtls->dimPtr = &mtls->redp.dim;
584 mtls->redp.dim.x = inType->getDimX();
585 mtls->redp.dim.y = inType->getDimY();
586 mtls->redp.dim.z = inType->getDimZ();
597 if (!setUpMtlsDimensions(mtls, mtls->redp.dim, sc)) {
602 mtls->end.x = rsMax((uint32_t)1, mtls->end.x);
603 mtls->end.y = rsMax((uint32_t)1, mtls->end.y);
605 mtls->rs = mCtx;
607 mtls->mSliceNum = 0;
608 mtls->mSliceSize = 1;
609 mtls->isThreadable = mIsThreadable;
612 mtls->redp.outLen = 1;
613 mtls->redp.outPtr[0] = (uint8_t *)aout->mHal.drvState.lod[0].mallocPtr;
614 mtls->redp.outStride[0] = aout->getType()->getElementSizeBytes();
617 memcpy(mtls->ains, ains, inLen * sizeof(ains[0]));
618 mtls->redp.inLen = inLen;
620 mtls->redp.inPtr[index] = (const uint8_t*)ains[index]->mHal.drvState.lod[0].mallocPtr;
621 mtls->redp.inStride[index] = ains[index]->getType()->getElementSizeBytes();
634 MTLaunchStructForEach *mtls) {
641 memset(mtls, 0, sizeof(MTLaunchStructForEach));
642 mtls->dimPtr = &mtls->fep.dim;
662 mtls->fep.dim.x = inType->getDimX();
663 mtls->fep.dim.y = inType->getDimY();
664 mtls->fep.dim.z = inType->getDimZ();
677 mtls->fep.dim.x = outType->getDimX();
678 mtls->fep.dim.y = outType->getDimY();
679 mtls->fep.dim.z = outType->getDimZ();
682 mtls->fep.dim.x = sc->xEnd;
683 mtls->fep.dim.y = sc->yEnd;
684 mtls->fep.dim.z = 0;
700 if (!setUpMtlsDimensions(mtls, mtls->fep.dim, sc)) {
705 mtls->end.x = rsMax((uint32_t)1, mtls->end.x);
706 mtls->end.y = rsMax((uint32_t)1, mtls->end.y);
707 mtls->rs = mCtx;
709 memcpy(mtls->ains, ains, inLen * sizeof(ains[0]));
711 mtls->aout[0] = aout;
712 mtls->fep.usr = usr;
713 mtls->fep.usrLen = usrLen;
714 mtls->mSliceSize = 1;
715 mtls->mSliceNum = 0;
717 mtls->isThreadable = mIsThreadable;
720 mtls->fep.inLen = inLen;
722 mtls->fep.inPtr[index] = (const uint8_t*)ains[index]->mHal.drvState.lod[0].mallocPtr;
723 mtls->fep.inStride[index] = ains[index]->getType()->getElementSizeBytes();
728 mtls->fep.outPtr[0] = (uint8_t *)aout->mHal.drvState.lod[0].mallocPtr;
729 mtls->fep.outStride[0] = aout->getType()->getElementSizeBytes();
745 MTLaunchStructForEach mtls;
747 if (forEachMtlsSetup(ains, inLen, aout, usr, usrLen, sc, &mtls)) {
748 forEachKernelSetup(slot, &mtls);
751 mCtx->launchForEach(ains, inLen, aout, sc, &mtls);
760 MTLaunchStructReduce mtls;
762 if (reduceMtlsSetup(ains, inLen, aout, sc, &mtls)) {
763 reduceKernelSetup(slot, &mtls);
765 mCtx->launchReduce(ains, inLen, aout, &mtls);
770 void RsdCpuScriptImpl::forEachKernelSetup(uint32_t slot, MTLaunchStructForEach *mtls) {
771 mtls->script = this;
772 mtls->fep.slot = slot;
773 mtls->kernel = mScriptExec->getForEachFunction(slot);
774 rsAssert(mtls->kernel != nullptr);
777 void RsdCpuScriptImpl::reduceKernelSetup(uint32_t slot, MTLaunchStructReduce *mtls) {
778 mtls->script = this;
779 mtls->redp.slot = slot;
782 mtls->accumFunc = desc->accumFunc;
783 mtls->initFunc = desc->initFunc; // might legally be nullptr
784 mtls->combFunc = desc->combFunc; // might legally be nullptr
785 mtls->outFunc = desc->outFunc; // might legally be nullptr
786 mtls->accumSize = desc->accumSize;
788 rsAssert(mtls->accumFunc != nullptr);