Library/ManagedCuda/CudaDeviceVariable.cs
/// <summary>
/// Async-Copies from device memory in one context to device memory in another context
/// </summary>
/// <param name="destCtx">Destination context</param>
/// <param name="source">Source pointer to device memory</param>
/// <param name="sourceCtx">Source context</param>
/// <param name="stream"></param>
Async-Copies from device memory in one context to device memory in another context
Async - Copies from device memory in one context to device memory in another context
public void PeerCopyToDevice(CudaContext destCtx, CudaDeviceVariable<T> source, CudaContext sourceCtx, CUstream stream)
		{
			if (disposed) throw new ObjectDisposedException(this.ToString());
			SizeT aSizeInBytes = _size * _typeSize;
			CUResult res;
			res = DriverAPINativeMethods.AsynchronousMemcpy_v2.cuMemcpyPeerAsync(_devPtr, destCtx.Context, source.DevicePointer, sourceCtx.Context, aSizeInBytes, stream);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpyPeerAsync", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
		}
public void PeerCopyToDevice ( CudaContext destCtx , CudaDeviceVariable < T > source , CudaContext sourceCtx , CUstream stream ) { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; SizeT aSizeInBytes = _size * _typeSize ; CUResult res ; res = DriverAPINativeMethods . AsynchronousMemcpy_v2 . cuMemcpyPeerAsync ( _devPtr , destCtx . Context , source . DevicePointer , sourceCtx . Context , aSizeInBytes , stream ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Async-Copies from device memory in one context to device memory in another context
Async - Copies from device memory in one context to device memory in another context
destCtx
CudaContext
None
source
CudaDeviceVariable<T>
Source pointer to device memory
Source pointer to device memory
sourceCtx
CudaContext
None
stream
CUstream
None