[Openmp-commits] [openmp] db8a967 - [OpenMP] kmp_affinity.h: add LoongArch64 support

Weining Lu via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 16 19:59:27 PST 2022


Author: zhanglimin
Date: 2022-11-17T11:59:00+08:00
New Revision: db8a96731f98105c88259ad881ff00198fe53a91

URL: https://github.com/llvm/llvm-project/commit/db8a96731f98105c88259ad881ff00198fe53a91
DIFF: https://github.com/llvm/llvm-project/commit/db8a96731f98105c88259ad881ff00198fe53a91.diff

LOG: [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

Added: 
    

Modified: 
    openmp/runtime/src/kmp_affinity.h

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_affinity.h b/openmp/runtime/src/kmp_affinity.h
index 42de135362ec9..f71bcfabafd97 100644
--- a/openmp/runtime/src/kmp_affinity.h
+++ b/openmp/runtime/src/kmp_affinity.h
@@ -256,6 +256,17 @@ class KMPHwlocAffinity : public KMPAffinity {
 #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_* */


        


More information about the Openmp-commits mailing list