瀏覽代碼

Check the return value of cudaFreeHost().

Cyril Roelandt 13 年之前
父節點
當前提交
98d152c83d
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/util/malloc.c

+ 3 - 1
src/util/malloc.c

@@ -185,7 +185,9 @@ int starpu_free(void *A)
 		/* This is especially useful when starpu_free is called from
  		 * the GCC-plugin. starpu_shutdown will probably have already
 		 * been called, so we will not be able to submit a task. */
-		cudaFreeHost(A);
+		cudaError_t err = cudaFreeHost(A);
+		if (STARPU_UNLIKELY(err))
+			STARPU_CUDA_REPORT_ERROR(err);
 	}
 	else if (_starpu_can_submit_cuda_task())
 	{