MCPcopy Create free account
hub / github.com/OpenPathGuidingLibrary/openpgl / Device

Method Device

openpgl/device/Device.h:48–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46#endif
47 public:
48 Device(size_t numThreads = 0)
49 {
50#ifdef OPENPGL_TASK_CONTROL
51 if (numThreads == 0)
52 {
53#if TBB_INTERFACE_VERSION >= 9100
54 m_numThreads = tbb::this_task_arena::max_concurrency();
55#else
56 m_numThreads = tbb::task_scheduler_init::default_num_threads();
57#endif
58 }
59 else
60 {
61#if TBB_INTERFACE_VERSION >= 9100
62 m_numThreads = std::min(numThreads, (size_t)tbb::this_task_arena::max_concurrency());
63#else
64 m_numThreads = std::min(numThreads, (size_t)tbb::task_scheduler_init::default_num_threads());
65#endif
66 }
67#if TBB_INTERFACE_VERSION >= 11005
68 g_opgl_tbb_thread_control = new tbb::global_control(tbb::global_control::max_allowed_parallelism, m_numThreads);
69#else
70 g_opgl_tbb_threads.initialize(int(m_numThreads));
71#endif
72#endif
73 VMMSingleLobeHenyeyGreensteinOracle::init();
74 }
75
76 ~Device() override
77 {

Callers

nothing calls this directly

Calls 2

minFunction · 0.50
initFunction · 0.50

Tested by

no test coverage detected