Class DriverAPINativeMethods.CudaPeerAccess
Peer Context Memory Access
Inheritance
Inherited Members
Namespace: ManagedCuda
Assembly: ManagedCuda.dll
Syntax
public static class CudaPeerAccess
Methods
cuCtxDisablePeerAccess(CUcontext)
Disables direct access to memory allocations in a peer context and unregisters any registered allocations.
Declaration
public static CUResult cuCtxDisablePeerAccess(CUcontext peerContext)
Parameters
Type | Name | Description |
---|---|---|
CUcontext | peerContext | Peer context to disable direct access to |
Returns
Type | Description |
---|---|
CUResult | CUDA Error Codes: Success, ErrorDeinitialized, ErrorNotInitialized,
ErrorPeerAccessNotEnabled, ErrorInvalidContext.
|
cuCtxEnablePeerAccess(CUcontext, CtxEnablePeerAccessFlags)
If both the current context and peerContext
are on devices which support unified
addressing (as may be queried using ::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING), then
on success all allocations from peerContext
will immediately be accessible
by the current context. See \ref CUDA_UNIFIED for additional
details.
Note that access granted by this call is unidirectional and that in order to access
memory from the current context in peerContext
, a separate symmetric call
to ::cuCtxEnablePeerAccess() is required.
Returns ErrorInvalidDevice if cuDeviceCanAccessPeer(ref Int32, CUdevice, CUdevice) indicates
that the CUdevice of the current context cannot directly access memory
from the CUdevice of peerContext
.
Returns ErrorPeerAccessAlreadyEnabled if direct access of
peerContext
from the current context has already been enabled.
Returns ErrorInvalidContext if there is no current context, peerContext
is not a valid context, or if the current context is peerContext
.
Returns ErrorInvalidValue if Flags
is not 0.
Declaration
public static CUResult cuCtxEnablePeerAccess(CUcontext peerContext, CtxEnablePeerAccessFlags Flags)
Parameters
Type | Name | Description |
---|---|---|
CUcontext | peerContext | Peer context to enable direct access to from the current context |
CtxEnablePeerAccessFlags | Flags | Reserved for future use and must be set to 0 |
Returns
Type | Description |
---|---|
CUResult | CUDA Error Codes: Success, ErrorDeinitialized, ErrorNotInitialized,
ErrorInvalidDevice, ErrorPeerAccessAlreadyEnabled, ErrorInvalidContext, ErrorInvalidValue.
|
cuDeviceCanAccessPeer(ref Int32, CUdevice, CUdevice)
Returns in canAccessPeer
a value of 1 if contexts on dev
are capable of
directly accessing memory from contexts on peerDev
and 0 otherwise.
If direct access of peerDev
from dev
is possible, then access may be
enabled on two specific contexts by calling cuCtxEnablePeerAccess(CUcontext, CtxEnablePeerAccessFlags).
Declaration
public static CUResult cuDeviceCanAccessPeer(ref int canAccessPeer, CUdevice dev, CUdevice peerDev)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | canAccessPeer | Returned access capability |
CUdevice | dev | Device from which allocations on peerDev are to be directly accessed. |
CUdevice | peerDev | Device on which the allocations to be directly accessed by dev reside. |
Returns
Type | Description |
---|---|
CUResult | CUDA Error Codes: Success, ErrorDeinitialized, ErrorNotInitialized,
ErrorInvalidDevice.
|
cuDeviceGetP2PAttribute(ref Int32, CUdevice_P2PAttribute, CUdevice, CUdevice)
Queries attributes of the link between two devices.
Returns in \p *value the value of the requested attribute \p attrib of the link between \p srcDevice and \p dstDevice. The supported attributes are:
- ::CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK: A relative value indicating the performance of the link between two devices.
- ::CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED P2P: 1 if P2P Access is enable.
- ::CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED: 1 if Atomic operations over the link are supported.
Declaration
public static CUResult cuDeviceGetP2PAttribute(ref int value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | Returned value of the requested attribute |
CUdevice_P2PAttribute | attrib | The requested attribute of the link between \p srcDevice and \p dstDevice. |
CUdevice | srcDevice | The source device of the target link. |
CUdevice | dstDevice | The destination device of the target link. |
Returns
Type | Description |
---|---|
CUResult |