Skip to content

Commit db8a967

Browse files
Ami-zhangSixWeining
authored andcommitted
[OpenMP] kmp_affinity.h: add LoongArch64 support
In D135552 the #else is added, which causes build error when building openmp on LoongArch. This patch fixed the error: "Unknown or unsupported architecture" Reviewed By: SixWeining, MaskRay Differential Revision: https://reviews.llvm.org/D137604
1 parent 4ae3e13 commit db8a967

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
@@ -256,6 +256,17 @@ class KMPHwlocAffinity : public KMPAffinity {
256256
#elif __NR_sched_getaffinity != 5196
257257
#error Wrong code for getaffinity system call.
258258
#endif /* __NR_sched_getaffinity */
259+
#elif KMP_ARCH_LOONGARCH64
260+
#ifndef __NR_sched_setaffinity
261+
#define __NR_sched_setaffinity 122
262+
#elif __NR_sched_setaffinity != 122
263+
#error Wrong code for setaffinity system call.
264+
#endif /* __NR_sched_setaffinity */
265+
#ifndef __NR_sched_getaffinity
266+
#define __NR_sched_getaffinity 123
267+
#elif __NR_sched_getaffinity != 123
268+
#error Wrong code for getaffinity system call.
269+
#endif /* __NR_sched_getaffinity */
259270
#else
260271
#error Unknown or unsupported architecture
261272
#endif /* KMP_ARCH_* */

0 commit comments

Comments
 (0)