Library/ManagedCuda/CudaDeviceVariable.cs
/// <summary>
/// Copy data from device to host memory
/// </summary>
/// <param name="dest">Destination pointer to host memory</param>
/// <param name="offsetSrc">Offset to source pointer in bytes</param>
/// <param name="offsetDest">Offset to destination pointer in bytes</param>
/// <param name="sizeInBytes">Size to copy in bytes</param>
Copy data from device to host memory
Copy data from device to host memory
public void CopyToHost(IntPtr dest, SizeT offsetSrc, SizeT offsetDest, SizeT sizeInBytes)
		{
			if (disposed) throw new ObjectDisposedException(this.ToString());
			CUResult res;
			IntPtr ptr = new IntPtr(dest.ToInt64() + (long)offsetDest);
			res = DriverAPINativeMethods.SynchronousMemcpy_v2.cuMemcpyDtoH_v2(ptr, _devPtr + offsetSrc, sizeInBytes);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpyDtoH", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
		}
public void CopyToHost ( IntPtr dest , SizeT offsetSrc , SizeT offsetDest , SizeT sizeInBytes ) { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; CUResult res ; IntPtr ptr = new IntPtr ( dest . ToInt64 ( ) + ( long ) offsetDest ) ; res = DriverAPINativeMethods . SynchronousMemcpy_v2 . cuMemcpyDtoH_v2 ( ptr , _devPtr + offsetSrc , sizeInBytes ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Copy data from device to host memory
Copy data from device to host memory
dest
IntPtr
Destination pointer to host memory
Destination pointer to host memory
offsetSrc
SizeT
Offset to source pointer in bytes
Offset to source pointer in bytes
offsetDest
SizeT
Offset to destination pointer in bytes
Offset to destination pointer in bytes
sizeInBytes
SizeT
Size to copy in bytes
Size to copy in bytes