Skip to content

Commit 622d329

Browse files
yabincpirama-arumuga-nainar
authored andcommitted
[OpenMP] kmp_affinity.h: add RISCV64 support
In D135552 the #else is added, which causes build error when building openmp on RISCV64. This patch fixed the error: "Unknown or unsupported architecture" Reviewed By: pirama Differential Revision: https://reviews.llvm.org/D138241
1 parent a98fc08 commit 622d329

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

openmp/runtime/src/kmp_affinity.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,17 @@ class KMPHwlocAffinity : public KMPAffinity {
267267
#elif __NR_sched_getaffinity != 123
268268
#error Wrong code for getaffinity system call.
269269
#endif /* __NR_sched_getaffinity */
270+
#elif KMP_ARCH_RISCV64
271+
#ifndef __NR_sched_setaffinity
272+
#define __NR_sched_setaffinity 122
273+
#elif __NR_sched_setaffinity != 122
274+
#error Wrong code for setaffinity system call.
275+
#endif /* __NR_sched_setaffinity */
276+
#ifndef __NR_sched_getaffinity
277+
#define __NR_sched_getaffinity 123
278+
#elif __NR_sched_getaffinity != 123
279+
#error Wrong code for getaffinity system call.
280+
#endif /* __NR_sched_getaffinity */
270281
#else
271282
#error Unknown or unsupported architecture
272283
#endif /* KMP_ARCH_* */

0 commit comments

Comments
 (0)