Library/ManagedCuda/CudaContext.cs
/// <summary>
/// Copy data from device to host memory
/// </summary>
/// <param name="aDest">Destination array in host memory</param>
/// <param name="aSource">Source CUdeviceptr (Pointer to device memory)</param>
Copy data from device to host memory
Copy data from device to host memory
public void CopyToHost(VectorTypes.float2[] aDest, CUdeviceptr aSource)
		{
			if (disposed) throw new ObjectDisposedException(this.ToString());
			CUResult res;
			res = DriverAPINativeMethods.SynchronousMemcpy_v2.cuMemcpyDtoH_v2(aDest, aSource, aDest.LongLength * Marshal.SizeOf(typeof(VectorTypes.float2)));
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpyDtoH_v2", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
		}
public void CopyToHost ( VectorTypes . float2 [ ] aDest , CUdeviceptr aSource ) { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; CUResult res ; res = DriverAPINativeMethods . SynchronousMemcpy_v2 . cuMemcpyDtoH_v2 ( aDest , aSource , aDest . LongLength * Marshal . SizeOf ( typeof ( VectorTypes . float2 ) ) ) ; 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
aDest
VectorTypes.float2[]
Destination array in host memory
Destination array in host memory
aSource
CUdeviceptr
Source CUdeviceptr (Pointer to device memory)
Source CUdeviceptr ( Pointer to device memory )