Przeglądaj źródła

Call STARPU_CUBLAS_REPORT_ERROR upon failure of a function from the CUBLAS library.

Patch generated by the tools/dev/experimental/use_starpu_cublas_report_error.cocci Coccinelle script.
Cyril Roelandt 12 lat temu
rodzic
commit
6178d5fd8d

+ 3 - 3
examples/heat/dw_factolu_kernels.c

@@ -135,7 +135,7 @@ static inline void dw_common_cpu_codelet_update_u22(void *descr[], int s, __attr
 					right, ld12, 1.0f, center, ld22);
 			status = cublasGetError();
 			if (status != CUBLAS_STATUS_SUCCESS)
-				STARPU_ABORT();
+				STARPU_CUBLAS_REPORT_ERROR(status);
 
 			cudaStreamSynchronize(starpu_cuda_get_local_stream());
 
@@ -200,7 +200,7 @@ static inline void dw_common_codelet_update_u12(void *descr[], int s, __attribut
 					1.0f, sub11, ld11, sub12, ld12);
 			status = cublasGetError();
 			if (status != CUBLAS_STATUS_SUCCESS)
-				STARPU_ABORT();
+				STARPU_CUBLAS_REPORT_ERROR(status);
 
 			cudaStreamSynchronize(starpu_cuda_get_local_stream());
 
@@ -262,7 +262,7 @@ static inline void dw_common_codelet_update_u21(void *descr[], int s, __attribut
 			cublasStrsm('R', 'U', 'N', 'U', ny21, nx21, 1.0f, sub11, ld11, sub21, ld21);
 			status = cublasGetError();
 			if (status != CUBLAS_STATUS_SUCCESS)
-				STARPU_ABORT();
+				STARPU_CUBLAS_REPORT_ERROR(status);
 
 			cudaStreamSynchronize(starpu_cuda_get_local_stream());
 

+ 2 - 1
gcc-plugin/examples/cholesky/cholesky_kernels.c

@@ -51,7 +51,8 @@ static inline void chol_common_cpu_codelet_update_u22(const float *left, const f
 					-1.0f, left, ld21, right, ld12,
 					 1.0f, center, ld22);
 			st = cublasGetError();
-			STARPU_ASSERT(!st);
+			if (STARPU_UNLIKELY(st != CUBLAS_STATUS_SUCCESS))
+				STARPU_CUBLAS_REPORT_ERROR(st);
 
 			cudaStreamSynchronize(starpu_cuda_get_local_stream());
 

+ 2 - 1
mpi/examples/cholesky/mpi_cholesky_kernels.c

@@ -63,7 +63,8 @@ static inline void chol_common_cpu_codelet_update_u22(void *descr[], int s, __at
 					-1.0f, left, ld21, right, ld12,
 					 1.0f, center, ld22);
 			st = cublasGetError();
-			STARPU_ASSERT(!st);
+			if (STARPU_UNLIKELY(st != CUBLAS_STATUS_SUCCESS))
+				STARPU_CUBLAS_REPORT_ERROR(st);
 
 			cudaStreamSynchronize(starpu_cuda_get_local_stream());