Browse Source

Check the return value of starpu_init() in tests/core/restart.

Cyril Roelandt 13 years ago
parent
commit
777782e36d
1 changed files with 4 additions and 3 deletions
  1. 4 3
      tests/core/restart.c

+ 4 - 3
tests/core/restart.c

@@ -31,7 +31,6 @@ struct timeval end;
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
-#if defined(STARPU_USE_CPU) || defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL)
 	unsigned iter;
 	unsigned iter;
 
 
 	double init_timing = 0.0;
 	double init_timing = 0.0;
@@ -44,6 +43,8 @@ int main(int argc, char **argv)
 		/* Initialize StarPU */
 		/* Initialize StarPU */
 		ret = starpu_init(NULL);
 		ret = starpu_init(NULL);
 		gettimeofday(&end, NULL);
 		gettimeofday(&end, NULL);
+		if (ret == -ENODEV)
+			goto enodev;
 		STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 		STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 		init_timing += (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
 		init_timing += (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
 
 
@@ -58,7 +59,7 @@ int main(int argc, char **argv)
 	FPRINTF(stderr, "starpu_shutdown: %2.2f seconds\n", shutdown_timing/(N*1000000));
 	FPRINTF(stderr, "starpu_shutdown: %2.2f seconds\n", shutdown_timing/(N*1000000));
 
 
 	return EXIT_SUCCESS;
 	return EXIT_SUCCESS;
-#else
+
+enodev:
 	return STARPU_TEST_SKIPPED;
 	return STARPU_TEST_SKIPPED;
-#endif
 }
 }