Library/ManagedCuda/CudaArray2D.cs
/// <summary>
/// Copy data from this array to host
/// </summary>
/// <param name="aHostDest">IntPtr to destination in host memory</param>
/// <param name="aElementSizeInBytes"></param>
Copy data from this array to host
Copy data from this array to host
public void CopyFromThisToHost(IntPtr aHostDest, SizeT aElementSizeInBytes)
        {
            CUDAMemCpy2D copyParams = new CUDAMemCpy2D();
            copyParams.dstHost = aHostDest;
            copyParams.dstMemoryType = CUMemoryType.Host;
            copyParams.srcArray = _cuArray;
            copyParams.srcMemoryType = CUMemoryType.Array;
            copyParams.Height = _arrayDescriptor.Height;
            copyParams.WidthInBytes = _arrayDescriptor.Width * aElementSizeInBytes;
            res = DriverAPINativeMethods.SynchronousMemcpy_v2.cuMemcpy2D_v2(ref copyParams);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpy2D", res));
            if (res != CUResult.Success)
                throw new CudaException(res);
        }
public void CopyFromThisToHost ( IntPtr aHostDest , SizeT aElementSizeInBytes ) { CUDAMemCpy2D copyParams = new CUDAMemCpy2D ( ) ; copyParams . dstHost = aHostDest ; copyParams . dstMemoryType = CUMemoryType . Host ; copyParams . srcArray = _cuArray ; copyParams . srcMemoryType = CUMemoryType . Array ; copyParams . Height = _arrayDescriptor . Height ; copyParams . WidthInBytes = _arrayDescriptor . Width * aElementSizeInBytes ; res = DriverAPINativeMethods . SynchronousMemcpy_v2 . cuMemcpy2D_v2 ( ref copyParams ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Copy data from this array to host
Copy data from this array to host
aHostDest
IntPtr
IntPtr to destination in host memory
IntPtr to destination in host memory
aElementSizeInBytes
SizeT
None