From 53a5318849e82605759ca7877e53a06dd6f17da2 Mon Sep 17 00:00:00 2001 From: jan2nov Date: Wed, 31 Oct 2018 23:09:59 +0000 Subject: [PATCH 1/2] correction of passing the correct value to MSD_DIT_size --- src/device_MSD_plane_profile.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/device_MSD_plane_profile.cu b/src/device_MSD_plane_profile.cu index 2637e77b..433749e3 100644 --- a/src/device_MSD_plane_profile.cu +++ b/src/device_MSD_plane_profile.cu @@ -444,7 +444,7 @@ void MSD_Interpolate_values(float *d_MSD_interpolated, float *d_MSD_DIT, std::ve // h_MSD_interpolated = new float[nWidths*MSD_INTER_SIZE]; // adding memory for the interpolate kernel - int MSD_DIT_size = h_boxcar_widths->size(); + int MSD_DIT_size = h_MSD_DIT_widths->size(); int *d_MSD_DIT_widths; int *d_boxcar; checkCudaErrors(cudaMalloc((void **) &d_MSD_DIT_widths, sizeof(int)*MSD_DIT_size)); From 4186b0e23c007f41d1e458cb660d719fc7670296 Mon Sep 17 00:00:00 2001 From: jan2nov Date: Thu, 1 Nov 2018 11:49:49 +0000 Subject: [PATCH 2/2] changing from the async copies to sync one. There should be no reason to have Async version one --- src/device_MSD_plane_profile.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/device_MSD_plane_profile.cu b/src/device_MSD_plane_profile.cu index 433749e3..13ff1987 100644 --- a/src/device_MSD_plane_profile.cu +++ b/src/device_MSD_plane_profile.cu @@ -448,9 +448,9 @@ void MSD_Interpolate_values(float *d_MSD_interpolated, float *d_MSD_DIT, std::ve int *d_MSD_DIT_widths; int *d_boxcar; checkCudaErrors(cudaMalloc((void **) &d_MSD_DIT_widths, sizeof(int)*MSD_DIT_size)); - checkCudaErrors(cudaMemcpyAsync(d_MSD_DIT_widths, &h_MSD_DIT_widths->operator[](0), sizeof(int)*MSD_DIT_size,cudaMemcpyHostToDevice)); + checkCudaErrors(cudaMemcpy(d_MSD_DIT_widths, &h_MSD_DIT_widths->operator[](0), sizeof(int)*MSD_DIT_size,cudaMemcpyHostToDevice)); cudaMalloc((void **) &d_boxcar, sizeof(int)*nWidths); - checkCudaErrors(cudaMemcpyAsync(d_boxcar, &h_boxcar_widths->operator[](0), sizeof(int)*nWidths,cudaMemcpyHostToDevice)); + checkCudaErrors(cudaMemcpy(d_boxcar, &h_boxcar_widths->operator[](0), sizeof(int)*nWidths,cudaMemcpyHostToDevice)); // checkCudaErrors(cudaMemcpy(h_MSD_DIT, d_MSD_DIT, nMSDs*MSD_RESULTS_SIZE*sizeof(float), cudaMemcpyDeviceToHost));