소스 검색

examples: fix variable scope

Nathalie Furmento 13 년 전
부모
커밋
9637814049
2개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 0
      examples/basic_examples/multiformat.c
  2. 1 1
      examples/reductions/dot_product.c

+ 4 - 0
examples/basic_examples/multiformat.c

@@ -21,8 +21,12 @@
 #include "multiformat_types.h"
 
 static int ncpu = 0;
+#ifdef STARPU_USE_CUDA
 static int ncuda = 0;
+#endif
+#ifdef STARPU_USE_OPENCL
 static int nopencl = 0;
+#endif
 
 static struct point array_of_structs[N_ELEMENTS];
 static starpu_data_handle_t array_of_structs_handle;

+ 1 - 1
examples/reductions/dot_product.c

@@ -40,11 +40,11 @@ static starpu_data_handle_t dot_handle;
 
 static int can_execute(unsigned workerid, struct starpu_task *task, unsigned nimpl)
 {
-	const struct cudaDeviceProp *props;
 	if (starpu_worker_get_type(workerid) == STARPU_CPU_WORKER)
 		return 1;
 #ifdef STARPU_USE_CUDA
 	/* Cuda device */
+	const struct cudaDeviceProp *props;
 	props = starpu_cuda_get_device_properties(workerid);
 	if (props->major >= 2 || props->minor >= 3)
 		/* At least compute capability 1.3, supports doubles */