Ver código fonte

Use the address of the local variable instead of its value

Cédric Augonnet 14 anos atrás
pai
commit
a0d754384d
1 arquivos alterados com 1 adições e 1 exclusões
  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