cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::device::peer_to_peer Namespace Reference

API functions and definitions relating to communications among peer CUDA GPU devices on the same system. More...

Typedefs

using attribute_t = CUdevice_P2PAttribute
 While Individual CUDA devices have individual "attributes" (attribute_t), there are also attributes characterizing pairs; this type is used for identifying/indexing them.
 

Functions

bool can_access (const device_t &accessor, const device_t &peer)
 Determine whether one CUDA device can access the global memory of another CUDA device. More...
 
void enable_access (const device_t &accessor, const device_t &peer)
 Enable access by one CUDA device to the global memory of another. More...
 
void disable_access (const device_t &accessor, const device_t &peer)
 Disable access by one CUDA device to the global memory of another. More...
 
bool can_access_each_other (const device_t &first, const device_t &second)
 Determine whether two CUDA devices can currently access each other.
 
void enable_bidirectional_access (const device_t &first, const device_t &second)
 Enable access both by the first to the second device and the other way around.
 
void disable_bidirectional_access (const device_t &first, const device_t &second)
 Disable access both by the first to the second device and the other way around.
 
attribute_value_t get_attribute (attribute_t attribute, const device_t &first, const device_t &second)
 Get one of the numeric attributes for a(n ordered) pair of devices, relating to their interaction. More...
 

Variables

constexpr const attribute_t link_performance_rank = CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK
 Aliases for CUDA driver GPU attribute codes. More...
 
constexpr const attribute_t access_support = CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED
 1 if access is supported, 0 otherwise
 
constexpr const attribute_t native_atomics_support = CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED
 1 if the first device can perform native atomic operations on the second device, 0 otherwise
 

Detailed Description

API functions and definitions relating to communications among peer CUDA GPU devices on the same system.

Function Documentation

◆ can_access()

bool cuda::device::peer_to_peer::can_access ( const device_t accessor,
const device_t peer 
)
inline

Determine whether one CUDA device can access the global memory of another CUDA device.

Parameters
accessordevice interested in making a remote access
peerdevice to be accessed
Returns
true iff acess is possible

◆ disable_access()

void cuda::device::peer_to_peer::disable_access ( const device_t accessor,
const device_t peer 
)
inline

Disable access by one CUDA device to the global memory of another.

Parameters
accessordevice interested in making a remote access
peerdevice to be accessed
Todo:
Consider disabling this, given that access is context-specific

◆ enable_access()

void cuda::device::peer_to_peer::enable_access ( const device_t accessor,
const device_t peer 
)
inline

Enable access by one CUDA device to the global memory of another.

Parameters
accessordevice interested in making a remote access
peerdevice to be accessed
Todo:
Consider disabling this, given that access is context-specific

◆ get_attribute()

attribute_value_t cuda::device::peer_to_peer::get_attribute ( attribute_t  attribute,
const device_t first,
const device_t second 
)
inline

Get one of the numeric attributes for a(n ordered) pair of devices, relating to their interaction.

Note
This is the device-pair equivalent of device_t::get_attribute()
Parameters
attributeidentifier of the attribute of interest
firstthe device accessing an att
seconddestination device
Returns
the numeric attribute value

Variable Documentation

◆ link_performance_rank

constexpr const attribute_t cuda::device::peer_to_peer::link_performance_rank = CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK

Aliases for CUDA driver GPU attribute codes.

A relative value indicating the performance of the link between two devices