[Openmp-commits] [PATCH] D137604: [OpenMP] kmp_affinity.h: add LoongArch support

Limin Zhang via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 7 19:58:30 PST 2022


Ami-zhang created this revision.
Ami-zhang added reviewers: SixWeining, wangleiat, xen0n, MaskRay, xry111, prcups.
Herald added subscribers: StephenFan, guansong, yaxunl.
Herald added a project: All.
Ami-zhang requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, 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 LoongArch. This patch fix the error:

  "Unknown or unsupported architecture"


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137604

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
@@ -256,6 +256,17 @@
 #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_* */


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137604.473864.patch
Type: text/x-patch
Size: 813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221108/36ba2c66/attachment.bin>


More information about the Openmp-commits mailing list