From 42a9356b4916d085d5a269cdb4cc439c8a87a7d5 Mon Sep 17 00:00:00 2001 From: Ben Ryan Date: Thu, 7 Nov 2024 13:57:21 -0700 Subject: [PATCH] This should be fixed... but I get a segfault on GPU --- src/utils/sort.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/sort.hpp b/src/utils/sort.hpp index a4ab8139dab3..3c91b1ec85ca 100644 --- a/src/utils/sort.hpp +++ b/src/utils/sort.hpp @@ -59,6 +59,8 @@ KOKKOS_INLINE_FUNCTION int upper_bound(const T &arr, Real val) { template void sort(ParArray1D data, KeyComparator comparator, size_t min_idx, size_t max_idx) { + Kokkos::fence(); + printf("%s:%i\n", __FILE__, __LINE__); PARTHENON_DEBUG_REQUIRE(min_idx < data.extent(0), "Invalid minimum sort index!"); PARTHENON_DEBUG_REQUIRE(max_idx < data.extent(0), "Invalid maximum sort index!"); #if defined(KOKKOS_ENABLE_CUDA) @@ -90,6 +92,8 @@ void sort(ParArray1D data, KeyComparator comparator, size_t min_idx, "touch by opening an issue on the Parthenon GitHub."); } #endif // KOKKOS_ENABLE_CUDA + Kokkos::fence(); + printf("%s:%i\n", __FILE__, __LINE__); } template