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

Dimitry Andric via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 16 13:22:03 PDT 2015


dim added a comment.

Note that using:

  __kmp_sys_max_nth = (int)KMP_MAX_NTH;

will not solve the conversion to -1.

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 */


http://reviews.llvm.org/D13827





More information about the Openmp-commits mailing list