[Openmp-commits] [openmp] 622d329 - [OpenMP] kmp_affinity.h: add RISCV64 support

Pirama Arumuga Nainar via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 17 16:04:34 PST 2022


Author: Yabin Cui
Date: 2022-11-18T00:03:59Z
New Revision: 622d329148bd59c92ca1b2e891a25b4600c361fc

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

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

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 f71bcfabafd97..5412aeac3da23 100644
--- a/openmp/runtime/src/kmp_affinity.h
+++ b/openmp/runtime/src/kmp_affinity.h
@@ -267,6 +267,17 @@ class KMPHwlocAffinity : public KMPAffinity {
 #elif __NR_sched_getaffinity != 123
 #error Wrong code for getaffinity system call.
 #endif /* __NR_sched_getaffinity */
+#elif KMP_ARCH_RISCV64
+#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