[Openmp-commits] [PATCH] D138241: [OpenMP] kmp_affinity.h: add RISCV64 support

Yabin Cui via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Nov 17 15:33:32 PST 2022


yabinc created this revision.
Herald added subscribers: sunshaoce, VincentWu, vkmr, evandro, luismarques, sameer.abuasal, s.egerton, Jim, benna, psnobl, PkmX, rogfer01, shiva0217, kito-cheng, guansong, simoncook, arichardson, yaxunl.
Herald added a project: All.
yabinc requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, pcwang-thead, eopXD, sstefan1.
Herald added a project: OpenMP.

In D135552 <https://reviews.llvm.org/D135552> the #else is added, which causes build error when
building openmp on RISCV64. This patch fixed the error:

  "Unknown or unsupported architecture"


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138241

Files:
  openmp/runtime/src/kmp_affinity.h


Index: openmp/runtime/src/kmp_affinity.h
===================================================================
--- openmp/runtime/src/kmp_affinity.h
+++ openmp/runtime/src/kmp_affinity.h
@@ -267,6 +267,17 @@
 #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_* */


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138241.476250.patch
Type: text/x-patch
Size: 808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221117/d2b2c659/attachment.bin>


More information about the Openmp-commits mailing list