MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / cpu_getAvailableNumThreads

Function cpu_getAvailableNumThreads

quest/src/cpu/cpu_config.cpp:78–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78int cpu_getAvailableNumThreads() {
79#if COMPILE_OPENMP
80 int n = -1;
81
82 #pragma omp parallel shared(n)
83 #pragma omp single
84 n = omp_get_num_threads();
85
86 return n;
87#else
88 error_cpuThreadsQueriedButEnvNotMultithreaded();
89 return -1;
90#endif
91}
92
93
94int cpu_getNumOpenmpProcessors() {

Tested by

no test coverage detected