Skip to content

Commit ebc5f02

Browse files
author
git apple-llvm automerger
committed
Merge commit '2ba5d820e2b0' from llvm.org/main into next
2 parents 52782b5 + 2ba5d82 commit ebc5f02

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

openmp/runtime/src/kmp_os.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@
8787
#define KMP_GROUP_AFFINITY 0
8888
#endif
8989

90+
#if (KMP_OS_LINUX || (KMP_OS_FREEBSD && __FreeBSD_version >= 1301000))
91+
#define KMP_HAVE_SCHED_GETCPU 1
92+
#else
93+
#define KMP_HAVE_SCHED_GETCPU 0
94+
#endif
95+
9096
/* Check for quad-precision extension. */
9197
#define KMP_HAVE_QUAD 0
9298
#if KMP_ARCH_X86 || KMP_ARCH_X86_64

openmp/runtime/src/ompt-general.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ OMPT_API_ROUTINE int ompt_get_partition_place_nums(int place_nums_size,
790790
OMPT_API_ROUTINE int ompt_get_proc_id(void) {
791791
if (!ompt_enabled.enabled || __kmp_get_gtid() < 0)
792792
return -1;
793-
#if KMP_OS_LINUX
793+
#if KMP_HAVE_SCHED_GETCPU
794794
return sched_getcpu();
795795
#elif KMP_OS_WINDOWS
796796
PROCESSOR_NUMBER pn;

0 commit comments

Comments
 (0)