OpenVDB 13.1.0
Loading...
Searching...
No Matches
DeviceMesh Class Reference

This class wraps a vector of per-device IDs and CUDA streams and holds inter-device connectivity information and NCCL comms. More...

#include <nanovdb/cuda/DeviceMesh.h>

Public Member Functions

 DeviceMesh ()
 Constructs a device mesh for all devices on the host and initializes a CUDA stream (and NCCL communicator) for each device.
 ~DeviceMesh ()
 Destroys the per-device CUDA stream and finalizes and destroys the per-device NCCL communicators.
 DeviceMesh (const DeviceMesh &)=delete
 Disallow copy-construction.
 DeviceMesh (DeviceMesh &&) noexcept
 Move constructor. Underlying CUDA streams and NCCL communicators are not reinitialized.
DeviceMeshoperator= (const DeviceMesh &)=delete
 Disallow copy-assignment.
DeviceMeshoperator= (DeviceMesh &&) noexcept
 Move assignment. Underlying CUDA streams and NCCL communicators are not reinitialized.
size_type deviceCount () const
 Returns the number of devices.
const DeviceNodeoperator[] (int deviceId) const
 Returns a const reference to the DeviceNode for a particular device.
const_iterator begin () const
 Returns an iterator to the first device node.
const_iterator end () const
 Returns an iterator past the last device node.
bool canAccessPeer (int deviceId, int peerId) const
 Returns whether or not peer to peer access is supported between two devices.

Detailed Description

This class wraps a vector of per-device IDs and CUDA streams and holds inter-device connectivity information and NCCL comms.

Constructor & Destructor Documentation

◆ DeviceMesh() [1/3]

DeviceMesh ( )
inline

Constructs a device mesh for all devices on the host and initializes a CUDA stream (and NCCL communicator) for each device.

◆ ~DeviceMesh()

~DeviceMesh ( )
inline

Destroys the per-device CUDA stream and finalizes and destroys the per-device NCCL communicators.

◆ DeviceMesh() [2/3]

DeviceMesh ( const DeviceMesh & )
delete

Disallow copy-construction.

◆ DeviceMesh() [3/3]

DeviceMesh ( DeviceMesh && other)
inlinenoexcept

Move constructor. Underlying CUDA streams and NCCL communicators are not reinitialized.

Parameters
otherDeviceMesh instance that will be moved into this DeviceMesh.

Member Function Documentation

◆ begin()

const_iterator begin ( ) const
inline

Returns an iterator to the first device node.

◆ canAccessPeer()

bool canAccessPeer ( int deviceId,
int peerId ) const
inline

Returns whether or not peer to peer access is supported between two devices.

◆ deviceCount()

size_type deviceCount ( ) const
inline

Returns the number of devices.

◆ end()

const_iterator end ( ) const
inline

Returns an iterator past the last device node.

◆ operator=() [1/2]

DeviceMesh & operator= ( const DeviceMesh & )
delete

Disallow copy-assignment.

◆ operator=() [2/2]

DeviceMesh & operator= ( DeviceMesh && other)
inlinenoexcept

Move assignment. Underlying CUDA streams and NCCL communicators are not reinitialized.

Parameters
otherDeviceMesh instance that will be moved into this DeviceMesh.

◆ operator[]()

const DeviceNode & operator[] ( int deviceId) const
inline

Returns a const reference to the DeviceNode for a particular device.