void PrimRefGen<Heuristic>::task_gen_parallel_reduce(size_t threadIndex, size_t threadCount, TaskScheduler::Event* event) { /* reduce geometry and centroid bounds */ size_t numAddedPrims = 0; BBox3fa geomBound = empty; BBox3fa centBound = empty; for (size_t i=0; i<numTasks; i++) { geomBound = merge(geomBound,geomBounds[i]); centBound = merge(centBound,centBounds[i]); numAddedPrims += work[i].numPrims; } new (&pinfo) PrimInfo(numAddedPrims,geomBound,centBound,pinfo); /* reduce heuristic and find best split */ Heuristic heuristic; Heuristic::reduce(heuristics,numTasks,heuristic); heuristic.best(split); }
void MultiThreadedSplitter<Heuristic,PrimRefBlockList>::task_split_parallel_reduce(size_t threadIndex, size_t threadCount, TaskScheduler::Event* event) { Heuristic lheuristic; Heuristic::reduce(lheuristics,numTasks,lheuristic); linfo = split.linfo; lheuristic.best(lsplit); Heuristic rheuristic; Heuristic::reduce(rheuristics,numTasks,rheuristic); rinfo = split.rinfo; rheuristic.best(rsplit); assert(linfo.size()); assert(rinfo.size()); cfun(cptr,threadIndex,threadCount,event); }