Browse Source

benefit from magma 1.4.0 and later being able to use an application-provided stream

Samuel Thibault 10 years ago
parent
commit
3621a2818e
1 changed files with 8 additions and 0 deletions
  1. 8 0
      examples/cholesky/cholesky_kernels.c

+ 8 - 0
examples/cholesky/cholesky_kernels.c

@@ -195,13 +195,21 @@ static inline void chol_common_codelet_update_u11(void *descr[], int s, STARPU_A
 			{
 			int ret;
 			int info;
+#if (MAGMA_VERSION_MAJOR > 1) || (MAGMA_VERSION_MAJOR == 1 && MAGMA_VERSION_MINOR >= 4)
+			cublasSetKernelStream(starpu_cuda_get_local_stream());
+			magmablasSetKernelStream(starpu_cuda_get_local_stream());
+#endif
 			ret = magma_spotrf_gpu(MagmaLower, nx, sub11, ld, &info);
 			if (ret != MAGMA_SUCCESS)
 			{
 				fprintf(stderr, "Error in Magma: %d\n", ret);
 				STARPU_ABORT();
 			}
+#if (MAGMA_VERSION_MAJOR > 1) || (MAGMA_VERSION_MAJOR == 1 && MAGMA_VERSION_MINOR >= 4)
+			cudaError_t cures = cudaStreamSynchronize(starpu_cuda_get_local_stream());
+#else
 			cudaError_t cures = cudaThreadSynchronize();
+#endif
 			STARPU_ASSERT(!cures);
 			}
 #else