From e0b3ad8e57f269e34085ba319aa399ee3476811a Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 16 Apr 2014 11:13:46 +0000 Subject: Replace direct cudaMemcpy2D calls by utility functions --- cuda/2d/sart.cu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cuda/2d/sart.cu') diff --git a/cuda/2d/sart.cu b/cuda/2d/sart.cu index 048661f..64d6f28 100644 --- a/cuda/2d/sart.cu +++ b/cuda/2d/sart.cu @@ -180,11 +180,11 @@ bool SART::iterate(unsigned int iterations) } // copy one line of sinogram to projection data - cudaMemcpy2D(D_projData, sizeof(float)*projPitch, D_sinoData + angle*sinoPitch, sizeof(float)*sinoPitch, sizeof(float)*(dims.iProjDets), 1, cudaMemcpyDeviceToDevice); + duplicateProjectionData(D_projData, D_sinoData, sinoPitch, dims); // do FP, subtracting projection from sinogram if (useVolumeMask) { - cudaMemcpy2D(D_tmpData, sizeof(float)*tmpPitch, D_volumeData, sizeof(float)*volumePitch, sizeof(float)*(dims.iVolWidth), dims.iVolHeight, cudaMemcpyDeviceToDevice); + duplicateVolumeData(D_tmpData, D_volumeData, volumePitch, dims); processVol(D_tmpData, D_maskData, tmpPitch, dims); callFP_SART(D_tmpData, tmpPitch, D_projData, projPitch, angle, -1.0f); } else { @@ -223,11 +223,11 @@ float SART::computeDiffNorm() zeroProjectionData(D_p, pPitch, dims); // copy sinogram to D_p - cudaMemcpy2D(D_p, sizeof(float)*pPitch, D_sinoData, sizeof(float)*sinoPitch, sizeof(float)*(dims.iProjDets), dims.iProjAngles, cudaMemcpyDeviceToDevice); + duplicateProjectionData(D_p, D_sinoData, sinoPitch, dims); // do FP, subtracting projection from sinogram if (useVolumeMask) { - cudaMemcpy2D(D_tmpData, sizeof(float)*tmpPitch, D_volumeData, sizeof(float)*volumePitch, sizeof(float)*(dims.iVolWidth), dims.iVolHeight, cudaMemcpyDeviceToDevice); + duplicateVolumeData(D_tmpData, D_volumeData, volumePitch, dims); processVol(D_tmpData, D_maskData, tmpPitch, dims); callFP(D_tmpData, tmpPitch, D_projData, projPitch, -1.0f); } else { -- cgit v1.2.3