[Openmp-commits] [PATCH] D13827: Avoid bad conversion for __kmp_sys_max_nth
Dimitry Andric via Openmp-commits
openmp-commits at lists.llvm.org
Mon Oct 19 09:49:44 PDT 2015
dim updated this revision to Diff 37766.
dim added a comment.
Use alternate method, which only requires changing the header:
- If PTHREADS_THREADS_MAX is defined, clamp it to INT_MAX
- If PTHREADS_THREADS_MAX is not defined, use INT_MAX
http://reviews.llvm.org/D13827
Files:
runtime/src/kmp.h
Index: runtime/src/kmp.h
===================================================================
--- runtime/src/kmp.h
+++ runtime/src/kmp.h
@@ -845,10 +845,10 @@
#define KMP_MIN_NTH 1
#ifndef KMP_MAX_NTH
-# ifdef PTHREAD_THREADS_MAX
+# if defined(PTHREAD_THREADS_MAX) && PTHREAD_THREADS_MAX < INT_MAX
# define KMP_MAX_NTH PTHREAD_THREADS_MAX
# else
-# define KMP_MAX_NTH (32 * 1024)
+# define KMP_MAX_NTH INT_MAX
# endif
#endif /* KMP_MAX_NTH */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13827.37766.patch
Type: text/x-patch
Size: 503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20151019/9ca7e6f9/attachment.bin>
More information about the Openmp-commits
mailing list