浏览代码

Fix build without CUDA.

Cyril Roelandt 13 年之前
父节点
当前提交
6558e0795e
共有 1 个文件被更改,包括 8 次插入1 次删除
  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
 }