Library/ManagedCuda/CudaDeviceVariable.cs
/// <summary>
/// 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>
Copies from device memory in one context to device memory in another context
Copies from device memory in one context to device memory in another context
public void PeerCopyToDevice(CudaContext destCtx, CUdeviceptr source, CudaContext sourceCtx)
		{
			if (disposed) throw new ObjectDisposedException(this.ToString());
			SizeT aSizeInBytes = _size * _typeSize;
			CUResult res;
			res = DriverAPINativeMethods.SynchronousMemcpy_v2.cuMemcpyPeer(_devPtr, destCtx.Context, source, sourceCtx.Context, aSizeInBytes);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuMemcpyPeer", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
		}
public void PeerCopyToDevice ( CudaContext destCtx , CUdeviceptr source , CudaContext sourceCtx ) { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; SizeT aSizeInBytes = _size * _typeSize ; CUResult res ; res = DriverAPINativeMethods . SynchronousMemcpy_v2 . cuMemcpyPeer ( _devPtr , destCtx . Context , source , sourceCtx . Context , aSizeInBytes ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Copies from device memory in one context to device memory in another context
Copies from device memory in one context to device memory in another context
destCtx
CudaContext
None
source
CUdeviceptr
Source pointer to device memory
Source pointer to device memory
sourceCtx
CudaContext
None