Browse Source

Use the address of the local variable instead of its value

Cédric Augonnet 14 years ago
parent
commit
a0d754384d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      tests/datawizard/manual_reduction.c

+ 1 - 1
tests/datawizard/manual_reduction.c

@@ -113,7 +113,7 @@ static void cuda_func_incr(void *descr[], void *cl_arg __attribute__((unused)))
 	unsigned h_val;
 	cudaMemcpy(&h_val, val, sizeof(unsigned), cudaMemcpyDeviceToHost);
 	h_val++;
-	cudaMemcpy(val, h_val, sizeof(unsigned), cudaMemcpyHostToDevice);
+	cudaMemcpy(val, &h_val, sizeof(unsigned), cudaMemcpyHostToDevice);
 }
 #endif