瀏覽代碼

tests/datawizard/interfaces/multiformat/advanced/same_handle.c: tests/datawizard/interfaces/multiformat/advanced/multiformat_worker.c: define code only when needed

Nathalie Furmento 13 年之前
父節點
當前提交
7b12ab4339

+ 4 - 0
tests/datawizard/interfaces/multiformat/advanced/multiformat_worker.c

@@ -18,8 +18,10 @@
 #include "generic.h"
 #include "../../../../helper.h"
 
+#if defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL)
 extern struct stats global_stats;
 static int vector[NX]; static starpu_data_handle_t handle;
+#endif
 
 #ifdef STARPU_USE_CUDA
 static int ncuda;
@@ -30,6 +32,7 @@ static int nopencl;
 static int opencl_worker;
 #endif
 
+#if defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL)
 static struct starpu_codelet cl =
 {
 	.where = STARPU_CUDA|STARPU_OPENCL,
@@ -88,6 +91,7 @@ create_and_submit_tasks(void)
 
 	return starpu_task_submit(task);
 }
+#endif
 
 int
 main(void)

+ 2 - 0
tests/datawizard/interfaces/multiformat/advanced/same_handle.c

@@ -22,6 +22,7 @@
  * A single handle can be given twice to a given kernel. In this case, it
  * should only be converted once.
  */
+#if defined(STARPU_USE_CUDA) || defined(STARPU_USE_OPENCL)
 extern struct stats global_stats;
 static int vector[NX]; static starpu_data_handle_t handle;
 
@@ -77,6 +78,7 @@ create_and_submit_tasks(void)
 
 	return 0;
 }
+#endif
 
 int
 main(void)