Fix missing endif and rearrange for non-Linux OpenMP

This commit is contained in:
Martin Kroeker 2021-11-03 20:37:31 +01:00 committed by GitHub
parent 85401a0add
commit 0e6639d0fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -246,16 +246,18 @@ int get_num_procs(void) {
#endif
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
#if !defined(OS_LINUX)
return nums;
#endif
#if defined(USE_OPENMP)
/* if (omp_get_proc_bind() != omp_proc_bind_false)*/
#if _OPENMP >= 201307
nums = omp_get_num_places();
#endif
return nums;
#endif
#endif
#if !defined(OS_LINUX)
return nums;
#endif
#if !defined(__GLIBC_PREREQ)
return nums;
@ -1813,9 +1815,7 @@ int get_num_procs(void) {
#endif
if (!nums) nums = sysconf(_SC_NPROCESSORS_CONF);
#if !defined(OS_LINUX)
return nums;
#endif
#if defined(USE_OPENMP)
/* if (omp_get_proc_bind() != omp_proc_bind_false) */
#if_OPENMP >= 201307
@ -1823,7 +1823,12 @@ int get_num_procs(void) {
#endif
return nums;
#endif
#endif
#if !defined(OS_LINUX)
return nums;
#endif
#if !defined(__GLIBC_PREREQ)
return nums;
#else