/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/Concurrency/src/setNThreads.cc
24 строки
734 B
Chris Jones
Use oneapi namespace
22 дек 2021, 00:32
22 дек 2021, 00:32
6cf8c1a
Код
Авторство
О чём код?
// // setNThreads.cc // CMSSW // // Created by Chris Jones on 7/24/20. // #include "oneapi/tbb/task_arena.h" #include "FWCore/Concurrency/interface/setNThreads.h" namespace edm { unsigned int setNThreads(unsigned int iNThreads, unsigned int iStackSize, std::unique_ptr<ThreadsController>& oPtr) { //stack size is given in KB but passed in as bytes iStackSize *= 1024; oPtr.reset(); if (0 == iNThreads) { //Allow TBB to decide how many threads. This is normally the number of CPUs in the machine. iNThreads = oneapi::tbb::this_task_arena::max_concurrency(); } oPtr = std::make_unique<ThreadsController>(static_cast<int>(iNThreads), iStackSize); return iNThreads; } } // namespace edm