Преглед изворни кода

src/core/workers.c: only define variables when needed

Nathalie Furmento пре 12 година
родитељ
комит
4e0ea93ff5
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      src/core/workers.c

+ 4 - 4
src/core/workers.c

@@ -163,22 +163,22 @@ static int _starpu_can_use_nth_implementation(enum starpu_archtype arch, struct
 	{
 	case STARPU_ANY_WORKER:
 	{
-		starpu_cpu_func_t cpu_func = _starpu_task_get_cpu_nth_implementation(cl, nimpl);
-		starpu_cuda_func_t cuda_func = _starpu_task_get_cuda_nth_implementation(cl, nimpl);
-		starpu_opencl_func_t opencl_func = _starpu_task_get_opencl_nth_implementation(cl, nimpl);
-		starpu_gordon_func_t gordon_func = _starpu_task_get_gordon_nth_implementation(cl, nimpl);
 		int cpu_func_enabled=1, cuda_func_enabled=1, opencl_func_enabled=1, gordon_func_enabled=1;
 
 #ifdef STARPU_USE_CPU
+		starpu_cpu_func_t cpu_func = _starpu_task_get_cpu_nth_implementation(cl, nimpl);
 		cpu_func_enabled = cpu_func != NULL && starpu_cpu_worker_get_count();
 #endif
 #ifdef STARPU_USE_CUDA
+		starpu_cuda_func_t cuda_func = _starpu_task_get_cuda_nth_implementation(cl, nimpl);
 		cuda_func_enabled = cuda_func != NULL && starpu_cuda_worker_get_count();
 #endif
 #ifdef STARPU_USE_OPENCL
+		starpu_opencl_func_t opencl_func = _starpu_task_get_opencl_nth_implementation(cl, nimpl);
 		opencl_func_enabled = opencl_func != NULL && starpu_opencl_worker_get_count();
 #endif
 #ifdef STARPU_USE_GORDON
+		starpu_gordon_func_t gordon_func = _starpu_task_get_gordon_nth_implementation(cl, nimpl);
 		gordon_func_enabled = gordon_func != 0 && starpu_spu_worker_get_count();
 #endif