浏览代码

examples/cpp: skip example when no worker is available

Nathalie Furmento 8 年之前
父节点
当前提交
b250311d52
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 2 0
      examples/cpp/add_vectors.cpp
  2. 2 0
      examples/cpp/add_vectors_cpp11.cpp

+ 2 - 0
examples/cpp/add_vectors.cpp

@@ -63,6 +63,8 @@ int main(int argc, char **argv)
 
 	// initialize StarPU with default configuration
 	int ret = starpu_init(NULL);
+	if (ret == -ENODEV)
+		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	// StarPU data registering

+ 2 - 0
examples/cpp/add_vectors_cpp11.cpp

@@ -68,6 +68,8 @@ int main(int argc, char **argv)
 
 	// initialize StarPU with default configuration
 	auto ret = starpu_init(NULL);
+	if (ret == -ENODEV)
+		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	// StarPU data registering