fix cudaMemcpy bug

This commit is contained in:
James E McClure 2019-05-17 21:12:44 -04:00
parent 60899a43d8
commit 7334c078fa

View File

@ -2519,7 +2519,7 @@ extern "C" double ScaLBL_D3Q19_AAeven_Flux_BC_z(int *list, double *dist, double
}
// Now read the total flux
cudaMemcpy(&sum,dvcsum,sizeof(double),cudaMemcpyDeviceToHost);
cudaMemcpy(&sum[0],dvcsum,sizeof(double),cudaMemcpyDeviceToHost);
din=sum[0];
err = cudaGetLastError();
if (cudaSuccess != err){
@ -2562,7 +2562,7 @@ extern "C" double ScaLBL_D3Q19_AAodd_Flux_BC_z(int *neighborList, int *list, dou
printf("CUDA error in ScaLBL_D3Q19_AAodd_Flux_BC_z (kernel): %s \n",cudaGetErrorString(err));
}
// Now read the total flux
cudaMemcpy(&sum,dvcsum,sizeof(double),cudaMemcpyDeviceToHost);
cudaMemcpy(&sum[0],dvcsum,sizeof(double),cudaMemcpyDeviceToHost);
din=sum[0];
err = cudaGetLastError();
if (cudaSuccess != err){