SHA256
1
0
forked from pool/mvapich2
mvapich2/mvapich2-s390_get_cycles.patch
Nicolas Morey 13e60bd8b4 - Add patches to fix compilation errors with GCC >= 14:
- mrail-fix-incompatible-pointer-issues.patch
  - util-add-missing-include.patch
  - psm-add-missing-declaration.patch
- Refresh 0001-Drop-real128.patch to work with patch -p0
- Switch to autopatch

OBS-URL: https://build.opensuse.org/package/show/science:HPC/mvapich2?expand=0&rev=103
2024-09-05 10:05:51 +00:00

28 lines
931 B
Diff

commit 92d5b11beaf8919979705f44d56eb0569feceb93
Author: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
Date: Thu Jun 8 15:11:12 2017 +0200
mvapich2-s390_get_cycles
Signed-off-by: Nicolas Morey-Chaisemartin <NMoreyChaisemartin@suse.com>
diff --git src/mpid/ch3/channels/common/include/mv2_clock.h src/mpid/ch3/channels/common/include/mv2_clock.h
index dba8e51bf129..af8bb2b77d08 100644
--- src/mpid/ch3/channels/common/include/mv2_clock.h
+++ src/mpid/ch3/channels/common/include/mv2_clock.h
@@ -93,6 +93,14 @@ static inline cycles_t get_cycles()
return ret;
}
+#elif defined(__s390__) || defined(__s390x__)
+typedef unsigned long cycles_t;
+static inline cycles_t get_cycles()
+{
+ unsigned long clk;
+ asm volatile("stck %0" : "=Q" (clk) : : "cc");
+ return clk >> 2;
+}
#else
#warning get_cycles not implemented for this architecture: attempt asm/timex.h
#include <asm/timex.h>