Sfoglia il codice sorgente

examples/cpp: skip example when no worker is available

Nathalie Furmento 8 anni fa
parent
commit
b250311d52
2 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  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