Skip to content

Commit 5a457e6

Browse files
committed
GPU Multithreading TBB: Isolate outer-loop thread from other inner loops
1 parent 3233a5b commit 5a457e6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

GPU/GPUTracking/Base/GPUReconstructionCPU.cxx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ inline int32_t GPUReconstructionCPUBackend::runKernelBackendInternal(const krnlS
7272
if (mProcessingSettings.debugLevel >= 5) {
7373
printf("Running %d Threads\n", nThreads);
7474
}
75-
mThreading->activeThreads->execute([&] {
76-
tbb::parallel_for(tbb::blocked_range<uint32_t>(0, x.nBlocks, 1), [&](const tbb::blocked_range<uint32_t>& r) {
77-
typename T::GPUSharedMemory smem;
78-
for (uint32_t iB = r.begin(); iB < r.end(); iB++) {
79-
T::template Thread<I>(x.nBlocks, 1, iB, 0, smem, T::Processor(*mHostConstantMem)[y.start + k], args...);
80-
}
75+
tbb::this_task_arena::isolate([&] {
76+
mThreading->activeThreads->execute([&] {
77+
tbb::parallel_for(tbb::blocked_range<uint32_t>(0, x.nBlocks, 1), [&](const tbb::blocked_range<uint32_t>& r) {
78+
typename T::GPUSharedMemory smem;
79+
for (uint32_t iB = r.begin(); iB < r.end(); iB++) {
80+
T::template Thread<I>(x.nBlocks, 1, iB, 0, smem, T::Processor(*mHostConstantMem)[y.start + k], args...);
81+
}
82+
});
8183
});
8284
});
8385
} else {

0 commit comments

Comments
 (0)