DPU C++ Host API  2025.1.0
dpu::DpuSet Class Reference

A set of DPUs. More...

#include <dpu.hpp>

Inheritance diagram for dpu::DpuSet:
[legend]
Collaboration diagram for dpu::DpuSet:
[legend]

Public Member Functions

std::vector< DpuSet * > & dpus ()
 
std::vector< DpuSet * > & ranks ()
 
DpuProgram load (const std::string &Executable)
 Load a DPU program on each DPU of the set. More...
 
void log (std::ostream &LogStream)
 Display the DPU logs on the given stream. More...
 
DpuSetAsync async ()
 
- Public Member Functions inherited from dpu::DpuSetOps
template<typename T >
void copy (const std::string &DstSymbol, unsigned Offset, const std::vector< T > &SrcBuffer, unsigned Size)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (const std::string &DstSymbol, unsigned Offset, const std::vector< T > &SrcBuffer)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (const std::string &DstSymbol, const std::vector< T > &SrcBuffer, unsigned Size)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (const std::string &DstSymbol, const std::vector< T > &SrcBuffer)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, unsigned Offset, const std::vector< T > &SrcBuffer, unsigned Size)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, unsigned Offset, const std::vector< T > &SrcBuffer)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, const std::vector< T > &SrcBuffer, unsigned Size)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, const std::vector< T > &SrcBuffer)
 Copy the same data to all the DPUs in the set. More...
 
template<typename T >
void copy (const std::string &DstSymbol, unsigned Offset, const std::vector< std::vector< T >> &SrcBuffers, unsigned Size)
 Copy the different buffers to the DPUs in the set. More...
 
template<typename T >
void copy (const std::string &DstSymbol, unsigned Offset, const std::vector< std::vector< T >> &SrcBuffers)
 Copy the different buffers to the DPUs in the set. More...
 
template<typename T >
void copy (const std::string &DstSymbol, const std::vector< std::vector< T >> &SrcBuffers, unsigned Size)
 Copy the different buffers to the DPUs in the set. More...
 
template<typename T >
void copy (const std::string &DstSymbol, const std::vector< std::vector< T >> &SrcBuffers)
 Copy the different buffers to the DPUs in the set. More...
 
void copyScatterGather (const std::string &DstSymbol, unsigned Offset, get_block_t &get_block_info, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
void copyScatterGather (const std::string &DstSymbol, get_block_t &get_block_info, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
template<class F >
void copyScatterGather (const std::string &DstSymbol, unsigned Offset, F f, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
template<class F >
void copyScatterGather (const std::string &DstSymbol, F f, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, unsigned Offset, const std::vector< std::vector< T >> &SrcBuffers, unsigned Size)
 Copy the different buffers to the DPUs in the set. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, unsigned Offset, const std::vector< std::vector< T >> &SrcBuffers)
 Copy the different buffers to the DPUs in the set. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, const std::vector< std::vector< T >> &SrcBuffers, unsigned Size)
 Copy the different buffers to the DPUs in the set. More...
 
template<typename T >
void copy (DpuSymbol &DstSymbol, const std::vector< std::vector< T >> &SrcBuffers)
 Copy the different buffers to the DPUs in the set. More...
 
void copyScatterGather (DpuSymbol &DstSymbol, unsigned Offset, get_block_t &get_block_info, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
void copyScatterGather (DpuSymbol &DstSymbol, get_block_t &get_block_info, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
template<class F >
void copyScatterGather (DpuSymbol &DstSymbol, unsigned Offset, F f, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
template<class F >
void copyScatterGather (DpuSymbol &DstSymbol, F f, unsigned Size, bool length_check=true)
 Copy the different buffers to the DPUs in the set with a scatter/gather transfer. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, unsigned Size, const std::string &SrcSymbol, unsigned Offset)
 Copy data from the DPUs in the set. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, unsigned Size, const std::string &SrcSymbol)
 Copy data from the DPUs in the set. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, const std::string &SrcSymbol, unsigned Offset)
 Copy data from the DPUs in the set. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, const std::string &SrcSymbol)
 Copy data from the DPUs in the set. More...
 
void copyScatterGather (get_block_t &get_block_info, unsigned Size, const std::string &SrcSymbol, unsigned Offset, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
void copyScatterGather (get_block_t &get_block_info, unsigned Size, const std::string &SrcSymbol, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
template<class F >
void copyScatterGather (F f, unsigned Size, const std::string &SrcSymbol, unsigned Offset, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
template<class F >
void copyScatterGather (F f, unsigned Size, const std::string &SrcSymbol, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, unsigned Size, DpuSymbol &SrcSymbol, unsigned Offset)
 Copy data from the DPUs in the set. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, unsigned Size, DpuSymbol &SrcSymbol)
 Copy data from the DPUs in the set. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, DpuSymbol &SrcSymbol, unsigned Offset)
 Copy data from the DPUs in the set. More...
 
template<typename T >
void copy (std::vector< std::vector< T >> &DstBuffers, DpuSymbol &SrcSymbol)
 Copy data from the DPUs in the set. More...
 
void copyScatterGather (get_block_t &get_block_info, unsigned Size, DpuSymbol &SrcSymbol, unsigned Offset, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
void copyScatterGather (get_block_t &get_block_info, unsigned Size, DpuSymbol &SrcSymbol, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
template<class F >
void copyScatterGather (F f, unsigned Size, DpuSymbol &SrcSymbol, unsigned Offset, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
template<class F >
void copyScatterGather (F f, unsigned Size, DpuSymbol &SrcSymbol, bool length_check=true)
 Copy data from the DPUs in the set with a scatter-gather transfer. More...
 
void exec ()
 Execute a DPU program. More...
 

Static Public Member Functions

static DpuSet allocate (unsigned NrDpus=ALLOCATE_ALL, const std::string &Profile="")
 Allocate a number of DPUs with the given profile. More...
 
static DpuSet allocateRanks (unsigned NrRanks=ALLOCATE_ALL, const std::string &Profile="")
 Allocate a number of DPU ranks with the given profile. More...
 

Friends

class DpuSetOps
 
class DpuSetAsync
 

Detailed Description

A set of DPUs.

Operations on DPUs are synchronous.

Member Function Documentation

◆ allocate()

static DpuSet dpu::DpuSet::allocate ( unsigned  NrDpus = ALLOCATE_ALL,
const std::string &  Profile = "" 
)
inlinestatic

Allocate a number of DPUs with the given profile.

Parameters
NrDpusthe number of DPUs to allocate (defaults to ALLOCATE_ALL)
Profilethe specific properties for the DPUs to allocate (defaults to an empty profile)
Returns
the set of DPUs
Exceptions
DpuErrorwhen the DPUs could not be allocated

◆ allocateRanks()

static DpuSet dpu::DpuSet::allocateRanks ( unsigned  NrRanks = ALLOCATE_ALL,
const std::string &  Profile = "" 
)
inlinestatic

Allocate a number of DPU ranks with the given profile.

Parameters
NrRanksthe number of DPU ranks to allocate (defaults to ALLOCATE_ALL)
Profilethe specific properties for the DPUs to allocate (defaults to an empty profile)
Returns
the set of DPUs
Exceptions
DpuErrorwhen the DPUs could not be allocated

◆ async()

DpuSetAsync dpu::DpuSet::async ( )
inline
Returns
an interface of the DPU set to execute asynchronous DPU operations

◆ dpus()

std::vector<DpuSet *>& dpu::DpuSet::dpus ( )
inline
Returns
the DPUs of the set

◆ load()

DpuProgram dpu::DpuSet::load ( const std::string &  Executable)
inline

Load a DPU program on each DPU of the set.

Parameters
Executablethe path to the DPU program
Returns
a representation of the DPU program containing the known symbols
Exceptions
DpuErrorwhen the DPU program could not be loaded

◆ log()

void dpu::DpuSet::log ( std::ostream &  LogStream)
inline

Display the DPU logs on the given stream.

Parameters
LogStreamwhere to display the logs
Exceptions
DpuErrorwhen the DPU logs could not be fetched or displayed

◆ ranks()

std::vector<DpuSet *>& dpu::DpuSet::ranks ( )
inline
Returns
the DPU ranks of the set

The documentation for this class was generated from the following file: