Browse Source

src/datawizard/copy_driver.c: use STARPU_CUDA_REPORT_ERROR instead of STARPU_ASSERT to provide a more suitable error message

Nathalie Furmento 15 years ago
parent
commit
449051b9ee
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/datawizard/copy_driver.c

+ 4 - 4
src/datawizard/copy_driver.c

@@ -119,13 +119,13 @@ cudaStream_t *stream;
 					}
 					else {
 						cures = cudaEventCreate(&req->async_channel.cuda_event);
-						STARPU_ASSERT(cures == cudaSuccess);
+						if (STARPU_UNLIKELY(cures != cudaSuccess)) STARPU_CUDA_REPORT_ERROR(cures);
 
 						stream = starpu_cuda_get_local_stream();
 						ret = copy_methods->cuda_to_ram_async(handle, src_node, dst_node, stream);
 
 						cures = cudaEventRecord(req->async_channel.cuda_event, *stream);
-						STARPU_ASSERT(cures == cudaSuccess);
+						if (STARPU_UNLIKELY(cures != cudaSuccess)) STARPU_CUDA_REPORT_ERROR(cures);
 					}
 				}
 				else
@@ -182,13 +182,13 @@ cudaStream_t *stream;
 				}
 				else {
 					cures = cudaEventCreate(&req->async_channel.cuda_event);
-					STARPU_ASSERT(cures == cudaSuccess);
+					if (STARPU_UNLIKELY(cures != cudaSuccess)) STARPU_CUDA_REPORT_ERROR(cures);
 
 					stream = starpu_cuda_get_local_stream();
 					ret = copy_methods->ram_to_cuda_async(handle, src_node, dst_node, stream);
 
 					cures = cudaEventRecord(req->async_channel.cuda_event, *stream);
-					STARPU_ASSERT(cures == cudaSuccess);
+					if (STARPU_UNLIKELY(cures != cudaSuccess)) STARPU_CUDA_REPORT_ERROR(cures);
 				}
 				break;
 			case STARPU_CUDA_RAM: