@@ -1369,6 +1369,7 @@ AC_MSG_RESULT($enable_debug)
AC_ARG_ENABLE(spinlock_check, [AS_HELP_STRING([--enable-spinlock-check], [enable spinlock check])], enable_spinlock_check=$enableval, enable_spinlock_check=no)
if test x$enable_debug = xyes; then
+ AC_DEFINE(STARPU_DEBUG, [1], [enable debugging statements])
CFLAGS="$CFLAGS -O0"
enable_spinlock_check=yes
else
@@ -588,6 +588,9 @@ int _starpu_cuda_driver_run_once(struct _starpu_worker_set *worker_set)
#endif
/* Synchronous execution */
{
+#if defined(STARPU_DEBUG) && !defined(STARPU_SIMGRID)
+ STARPU_ASSERT_MSG(cudaStreamQuery(starpu_cuda_get_local_stream()) == cudaSuccess, "CUDA codelets have to wait for termination of their kernels on the starpu_cuda_get_local_stream() stream");
+#endif
finish_job_on_cuda(j, args);
}
_STARPU_TRACE_START_PROGRESS(memnode);