MCPcopy Create free account
hub / github.com/RenderKit/embree / initTaskingSystem

Method initTaskingSystem

kernels/common/device.cpp:371–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369 }
370
371 void Device::initTaskingSystem(size_t numThreads)
372 {
373 Lock<MutexSys> lock(g_mutex);
374 if (numThreads == 0)
375 g_num_threads_map[this] = std::numeric_limits<size_t>::max();
376 else
377 g_num_threads_map[this] = numThreads;
378
379 /* create task scheduler */
380 size_t maxNumThreads = getMaxNumThreads();
381 TaskScheduler::create(maxNumThreads,State::set_affinity,State::start_threads);
382#if USE_TASK_ARENA
383 const size_t nThreads = min(maxNumThreads,TaskScheduler::threadCount());
384 const size_t uThreads = min(max(numUserThreads,(size_t)1),nThreads);
385 arena->arena = make_unique(new tbb::task_arena((int)nThreads,(unsigned int)uThreads));
386#endif
387 }
388
389 void Device::exitTaskingSystem()
390 {

Callers

nothing calls this directly

Calls 5

getMaxNumThreadsFunction · 0.85
createFunction · 0.85
maxFunction · 0.50
minFunction · 0.50
make_uniqueFunction · 0.50

Tested by

no test coverage detected