From 293ed3501c8bf21e75a8b94742d1de1325a8d150 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Wed, 3 Oct 2018 00:58:17 +0200 Subject: [PATCH] Call cudaStreamSynchronize before debug prints --- src/debug.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/debug.h b/src/debug.h index 5335de0..73ff1e9 100644 --- a/src/debug.h +++ b/src/debug.h @@ -74,8 +74,12 @@ class DbgTracer { void traceVal(const char *name, const T& obj, int line, bool always = false) { (void)line; - if (debug || always) + if (debug || always) { +#ifdef CUFFT + CudaSafeCall(cudaStreamSynchronize(cudaStreamPerThread)); +#endif std::cerr << indent() << name /*<< " @" << line */ << " " << print(obj) << std::endl; + } } template struct Printer { -- 2.39.2