瀏覽代碼

Return 77 instead of crashing when there are no devices.

Cyril Roelandt 13 年之前
父節點
當前提交
6021410a4a
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 1 1
      examples/heat/dw_factolu.c
  2. 2 0
      examples/heat/dw_sparse_cg.c

+ 1 - 1
examples/heat/dw_factolu.c

@@ -697,7 +697,7 @@ void initialize_system(float **A, float **B, unsigned dim, unsigned pinned)
 
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV)
-		return 77;
+		exit(77);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();

+ 2 - 0
examples/heat/dw_sparse_cg.c

@@ -427,6 +427,8 @@ void do_conjugate_gradient(float *nzvalA, float *vecb, float *vecx, uint32_t nnz
 	int ret;
 
 	ret = starpu_init(NULL);
+	if (ret == -ENODEV)
+		exit(77);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();