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