Explorar o código

Fix build without CUDA.

Cyril Roelandt %!s(int64=13) %!d(string=hai) anos
pai
achega
6558e0795e
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      src/core/workers.c

+ 8 - 1
src/core/workers.c

@@ -929,8 +929,15 @@ extern int _starpu_run_cuda(struct starpu_driver *);
 int
 starpu_run_driver(struct starpu_driver *d)
 {
-	if (!d || d->type != STARPU_CUDA_WORKER)
+	if (!d)
+		return -EINVAL;
+
+#ifdef STARPU_USE_CUDA
+	if (d->type != STARPU_CUDA_WORKER)
 		return -EINVAL;
 
 	return _starpu_run_cuda(d);
+#else
+	return -ENODEV;
+#endif
 }