]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Call cudaStreamSynchronize before debug prints
authorMichal Sojka <michal.sojka@cvut.cz>
Tue, 2 Oct 2018 22:58:17 +0000 (00:58 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Tue, 2 Oct 2018 22:58:17 +0000 (00:58 +0200)
src/debug.h

index 5335de0b045c5f50627d420f21623adaa6a2b0c6..73ff1e95e292f81ccf1e2e6caaa03565c9e82044 100644 (file)
@@ -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 <typename T> struct Printer {