]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Don't define __ATOMIC_* in bundled Kokkos 16882/head
authorDaniel Arndt <arndtd@ornl.gov>
Fri, 12 Apr 2024 15:32:51 +0000 (10:32 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 12 Apr 2024 15:33:21 +0000 (10:33 -0500)
bundled/kokkos-3.7.00/tpls/desul/include/desul/atomics/Common.hpp

index aef098e4d8caf6b0d7e9a418cdeff0a9349acce0..db2229f7ddf95f357e073818ea1e820fd89deec1 100644 (file)
@@ -57,13 +57,35 @@ struct MemoryScopeCore {};
 struct MemoryScopeCaller {};
 }  // namespace desul
 
-#ifndef __ATOMIC_RELAXED
-#define __ATOMIC_RELAXED 0
-#define __ATOMIC_CONSUME 1
-#define __ATOMIC_ACQUIRE 2
-#define __ATOMIC_RELEASE 3
-#define __ATOMIC_ACQ_REL 4
-#define __ATOMIC_SEQ_CST 5
+#ifdef __ATOMIC_RELAXED
+#define KOKKOS_ATOMIC_RELAXED __ATOMIC_RELAXED
+#else
+#define KOKKOS_ATOMIC_RELAXED 0
+#endif
+#ifdef __ATOMIC_CONSUME
+#define KOKKOS_ATOMIC_CONSUME __ATOMIC_CONSUME
+#else
+#define KOKKOS_ATOMIC_CONSUME 1
+#endif
+#ifdef __ATOMIC_ACQUIRE
+#define KOKKOS_ATOMIC_ACQUIRE __ATOMIC_ACQUIRE
+#else
+#define KOKKOS_ATOMIC_ACQUIRE 2
+#endif
+#ifdef __ATOMIC_RELEASE
+#define KOKKOS_ATOMIC_RELEASE __ATOMIC_RELEASE
+#else
+#define KOKKOS_ATOMIC_RELEASE 3
+#endif
+#ifdef __ATOMIC_ACQ_REL
+#define KOKKOS_ATOMIC_ACQ_REL __ATOMIC_ACQ_REL
+#else
+#define KOKKOS_ATOMIC_ACQ_REL 4
+#endif
+#ifdef __ATOMIC_SEQ_CST
+#define KOKKOS_ATOMIC_SEQ_CST __ATOMIC_SEQ_CST
+#else
+#define KOKKOS_ATOMIC_SEQ_CST 5
 #endif
 
 namespace desul {
@@ -72,27 +94,27 @@ struct GCCMemoryOrder;
 
 template <>
 struct GCCMemoryOrder<MemoryOrderRelaxed> {
-  static constexpr int value = __ATOMIC_RELAXED;
+  static constexpr int value = KOKKOS_ATOMIC_RELAXED;
 };
 
 template <>
 struct GCCMemoryOrder<MemoryOrderAcquire> {
-  static constexpr int value = __ATOMIC_ACQUIRE;
+  static constexpr int value = KOKKOS_ATOMIC_ACQUIRE;
 };
 
 template <>
 struct GCCMemoryOrder<MemoryOrderRelease> {
-  static constexpr int value = __ATOMIC_RELEASE;
+  static constexpr int value = KOKKOS_ATOMIC_RELEASE;
 };
 
 template <>
 struct GCCMemoryOrder<MemoryOrderAcqRel> {
-  static constexpr int value = __ATOMIC_ACQ_REL;
+  static constexpr int value = KOKKOS_ATOMIC_ACQ_REL;
 };
 
 template <>
 struct GCCMemoryOrder<MemoryOrderSeqCst> {
-  static constexpr int value = __ATOMIC_SEQ_CST;
+  static constexpr int value = KOKKOS_ATOMIC_SEQ_CST;
 };
 
 template <class MemoryOrderDesul>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.