[Openmp-commits] [PATCH] D13827: Avoid bad conversion for __kmp_sys_max_nth

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 19 09:32:57 PDT 2015


jlpeyton added a comment.

> Alternatively, we could `#ifdef` it in `runtime/src/kmp.h`, e.g.:

> 

>   #ifndef KMP_MAX_NTH

>   #  ifdef PTHREAD_THREADS_MAX

>   #    if PTHREAD_THREADS_MAX < INT_MAX

>   #      define KMP_MAX_NTH        PTHREAD_THREADS_MAX

>   #    else

>   #      define KMP_MAX_NTH        INT_MAX

>   #    endif

>   #  else

>   #    define KMP_MAX_NTH          (32 * 1024)

>   #  endif

>   #endif /* KMP_MAX_NTH */


I would prefer this method.  You can change the 32 * 1024 to INT_MAX as well.


http://reviews.llvm.org/D13827





More information about the Openmp-commits mailing list