Library/ManagedCuda/CudaContext.cs
/// <summary>
/// Copy data from host to device memory
/// </summary>
/// <param name="aDest">Destination CUdeviceptr (Pointer to device memory)</param>
/// <param name="aSource">Source array</param>
Copy data from host to device memory
Copy data from host to device memory
public void CopyToDevice(CUdeviceptr aDest, sbyte[] aSource)
		{
			if (disposed) throw new ObjectDisposedException(this.ToString());
			CUResult res;
			res = DriverAPINativeMethods.SynchronousMemcpy_v2.cuMemcpyHtoD_v2(aDest, aSource, (aSource.LongLength * sizeof(sbyte)));
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpyHtoD", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
		}
public void CopyToDevice ( CUdeviceptr aDest , sbyte [ ] aSource ) { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; CUResult res ; res = DriverAPINativeMethods . SynchronousMemcpy_v2 . cuMemcpyHtoD_v2 ( aDest , aSource , ( aSource . LongLength * sizeof ( sbyte ) ) ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Copy data from host to device memory
Copy data from host to device memory
aDest
CUdeviceptr
Destination CUdeviceptr (Pointer to device memory)
Destination CUdeviceptr ( Pointer to device memory )
aSource
sbyte[]
None