浏览代码

always set the kernel stream in the codelet itself, since magma apparently changes it dynamically

Samuel Thibault 10 年之前
父节点
当前提交
5f2955555e

+ 0 - 3
examples/cholesky/cholesky_grain_tag.c

@@ -277,8 +277,6 @@ static void initialize_system(float **A, unsigned dim, unsigned pinned)
 	initialize_chol_model(&chol_model_22,"chol_model_22",cpu_chol_task_22_cost,NULL);
 #endif
 
-	starpu_cublas_init();
-
 #ifndef STARPU_SIMGRID
 	if (pinned)
 	{
@@ -323,7 +321,6 @@ static void shutdown_system(float **matA, unsigned pinned)
 	     free(*matA);
 	}
 
-	starpu_cublas_shutdown();
 	starpu_shutdown();
 }
 

+ 0 - 3
examples/cholesky/cholesky_implicit.c

@@ -331,8 +331,6 @@ int main(int argc, char **argv)
 	initialize_chol_model(&chol_model_22,"chol_model_22",cpu_chol_task_22_cost,NULL);
 #endif
 
-	starpu_cublas_init();
-
 	if(with_ctxs)
 	{
 		construct_contexts(execute_cholesky);
@@ -347,7 +345,6 @@ int main(int argc, char **argv)
 	else
 		execute_cholesky(size, nblocks);
 
-	starpu_cublas_shutdown();
 	starpu_shutdown();
 
 	return ret;

+ 2 - 0
examples/cholesky/cholesky_kernels.c

@@ -71,6 +71,7 @@ static inline void chol_common_cpu_codelet_update_u22(void *descr[], int s, STAR
 	{
 		/* CUDA kernel */
 #ifdef STARPU_USE_CUDA
+		cublasSetKernelStream(starpu_cuda_get_local_stream());
 		cublasSgemm('n', 't', dy, dx, dz, 
 				-1.0f, left, ld21, right, ld12, 
 				 1.0f, center, ld22);
@@ -117,6 +118,7 @@ static inline void chol_common_codelet_update_u21(void *descr[], int s, STARPU_A
 			break;
 #ifdef STARPU_USE_CUDA
 		case 1:
+			cublasSetKernelStream(starpu_cuda_get_local_stream());
 			cublasStrsm('R', 'L', 'T', 'N', nx21, ny21, 1.0f, sub11, ld11, sub21, ld21);
 			break;
 #endif

+ 0 - 3
examples/cholesky/cholesky_tag.c

@@ -244,8 +244,6 @@ static int initialize_system(float **A, unsigned dim, unsigned pinned)
 	initialize_chol_model(&chol_model_22,"chol_model_22",cpu_chol_task_22_cost,NULL);
 #endif
 
-	starpu_cublas_init();
-
 #ifndef STARPU_SIMGRID
 	if (pinned)
 	{
@@ -299,7 +297,6 @@ static void shutdown_system(float **matA, unsigned pinned)
 		free(*matA);
 	}
 
-	starpu_cublas_shutdown();
 	starpu_shutdown();
 }