From db8a96731f98105c88259ad881ff00198fe53a91 Mon Sep 17 00:00:00 2001 From: zhanglimin Date: Thu, 17 Nov 2022 11:58:57 +0800 Subject: [PATCH] [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 --- openmp/runtime/src/kmp_affinity.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/openmp/runtime/src/kmp_affinity.h b/openmp/runtime/src/kmp_affinity.h index 42de135..f71bcfa 100644 --- a/openmp/runtime/src/kmp_affinity.h +++ b/openmp/runtime/src/kmp_affinity.h @@ -256,6 +256,17 @@ public: #elif __NR_sched_getaffinity != 5196 #error Wrong code for getaffinity system call. #endif /* __NR_sched_getaffinity */ +#elif KMP_ARCH_LOONGARCH64 +#ifndef __NR_sched_setaffinity +#define __NR_sched_setaffinity 122 +#elif __NR_sched_setaffinity != 122 +#error Wrong code for setaffinity system call. +#endif /* __NR_sched_setaffinity */ +#ifndef __NR_sched_getaffinity +#define __NR_sched_getaffinity 123 +#elif __NR_sched_getaffinity != 123 +#error Wrong code for getaffinity system call. +#endif /* __NR_sched_getaffinity */ #else #error Unknown or unsupported architecture #endif /* KMP_ARCH_* */ -- 2.7.4