From 27e61f60a8871116a138ffacec742947af8191a2 Mon Sep 17 00:00:00 2001 From: Peter Doak Date: Wed, 6 Aug 2025 12:50:22 -0400 Subject: [PATCH] this way of using event sync fails in hip --- include/dca/linalg/util/memory.hpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/dca/linalg/util/memory.hpp b/include/dca/linalg/util/memory.hpp index 482ab3f5d..974dfb60c 100644 --- a/include/dca/linalg/util/memory.hpp +++ b/include/dca/linalg/util/memory.hpp @@ -108,7 +108,7 @@ struct Memory { } - + // Do nothing for non arithmetic types. template @@ -123,10 +123,7 @@ struct Memory { template static void setToZero(ScalarType* ptr, size_t size, const GpuStream& stream) { checkRC(cudaMemsetAsync(ptr, 0, size * sizeof(ScalarType), stream)); - cudaEvent_t zero_event; - checkRC(cudaEventCreateWithFlags(&zero_event, cudaEventBlockingSync)); - checkRC(cudaEventRecord(zero_event, stream)); - checkRC(cudaEventSynchronize(zero_event)); + checkRC(cudaStreamSynchronize(stream)); } }; #endif // DCA_HAVE_GPU