| 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 | { |
nothing calls this directly
no test coverage detected