ソースを参照

tests/microbenchs/matrix_as_vector.c: always declare cuda kernels, and give them a empty body when cuda is not enabled

Nathalie Furmento 13 年 前
コミット
4a858bf87c
共有1 個のファイルを変更した4 個の追加4 個の削除を含む
  1. 4 4
      tests/microbenchs/matrix_as_vector.c

+ 4 - 4
tests/microbenchs/matrix_as_vector.c

@@ -37,9 +37,9 @@ void vector_cpu_func(void *descr[], void *cl_arg __attribute__((unused)))
 	matrix[0] = sum/nx;
 }
 
-#ifdef STARPU_USE_CUDA
 void vector_cuda_func(void *descr[], void *cl_arg __attribute__((unused)))
 {
+#ifdef STARPU_USE_CUDA
 	STARPU_SKIP_IF_VALGRIND;
 
 	float *matrix = (float *)STARPU_VECTOR_GET_PTR(descr[0]);
@@ -51,8 +51,8 @@ void vector_cuda_func(void *descr[], void *cl_arg __attribute__((unused)))
 
 	cudaMemcpy(matrix, &sum, sizeof(matrix[0]), cudaMemcpyHostToDevice);
 	cudaThreadSynchronize();
-}
 #endif /* STARPU_USE_CUDA */
+}
 
 void matrix_cpu_func(void *descr[], void *cl_arg __attribute__((unused)))
 {
@@ -68,9 +68,9 @@ void matrix_cpu_func(void *descr[], void *cl_arg __attribute__((unused)))
 	matrix[0] = sum / (nx*ny);
 }
 
-#ifdef STARPU_USE_CUDA
 void matrix_cuda_func(void *descr[], void *cl_arg __attribute__((unused)))
 {
+#ifdef STARPU_USE_CUDA
 	STARPU_SKIP_IF_VALGRIND;
 
 	float *matrix = (float *)STARPU_MATRIX_GET_PTR(descr[0]);
@@ -83,8 +83,8 @@ void matrix_cuda_func(void *descr[], void *cl_arg __attribute__((unused)))
 
 	cudaMemcpy(matrix, &sum, sizeof(matrix[0]), cudaMemcpyHostToDevice);
 	cudaThreadSynchronize();
-}
 #endif /* STARPU_USE_CUDA */
+}
 
 int check_size(int nx, struct starpu_codelet *vector_codelet, struct starpu_codelet *matrix_codelet, char *device_name)
 {