UCX++
Public Member Functions | List of all members
ucxpp::remote_memory_handle Class Reference

Represents a remote memory region. Note that this does not contain the remote address. It should be kept by the user. More...

#include <ucxpp/memory.h>

Inheritance diagram for ucxpp::remote_memory_handle:
Inheritance graph
[legend]
Collaboration diagram for ucxpp::remote_memory_handle:
Collaboration graph
[legend]

Public Member Functions

 remote_memory_handle (std::shared_ptr< endpoint > endpoint, void const *packed_rkey_buffer)
 Construct a new remote memory handle object. All subsequent remote memory access will happen on the given endpoint. More...
 
 remote_memory_handle (remote_memory_handle &&other)
 Construct a new remote memory handle object. More...
 
rma_put_awaitable put (void const *buffer, size_t length, uint64_t remote_addr) const
 Write to the remote memory region. More...
 
rma_get_awaitable get (void *buffer, size_t length, uint64_t remote_addr) const
 Read from the remote memory region. More...
 
rma_put_awaitable write (void const *buffer, size_t length, uint64_t remote_addr) const
 
rma_get_awaitable read (void *buffer, size_t length, uint64_t remote_addr) const
 
std::shared_ptr< endpointendpoint_ptr () const
 Get the memory region's endpoint object. More...
 
ucp_rkey_h handle () const
 Get the native UCX rkey handle. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_fetch_add (uint64_t remote_addr, T const &delta, T &old_value) const
 Atomically fetch and add a value to the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_fetch_and (uint64_t remote_addr, T const &bits, T &old_value) const
 Atomically fetch and AND a value to the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_fetch_or (uint64_t remote_addr, T const &bits, T &old_value) const
 Atomically fetch and OR a value to the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_fetch_xor (uint64_t remote_addr, T const &bits, T &old_value) const
 Atomically fetch and XOR a value to the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_add (uint64_t remote_addr, T const &delta) const
 Atomically add to a value in the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_and (uint64_t remote_addr, T const &bits) const
 Atomically AND a value in the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_or (uint64_t remote_addr, T const &bits) const
 Atomically OR to a value in the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_xor (uint64_t remote_addr, T const &bits) const
 Atomically XOR a value to the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_swap (uint64_t remote_addr, T const &new_value, T &old_value) const
 Atomically swap a value in the remote memory region. More...
 
template<class T >
rma_atomic_awaitable< T > atomic_compare_swap (uint64_t raddr, T const &expected, T &desired_and_old) const
 Atomically compare and swap a value in the remote memory region. More...
 
 ~remote_memory_handle ()
 Destroy the remote memory handle object and the associated rkey handle.
 
- Public Member Functions inherited from ucxpp::noncopyable
 noncopyable (noncopyable &&)=default
 
 noncopyable (noncopyable const &)=delete
 
noncopyableoperator= (noncopyable const &)=delete
 
noncopyableoperator= (noncopyable &&)=default
 

Detailed Description

Represents a remote memory region. Note that this does not contain the remote address. It should be kept by the user.

Examples
helloworld.cc.

Constructor & Destructor Documentation

◆ remote_memory_handle() [1/2]

ucxpp::remote_memory_handle::remote_memory_handle ( std::shared_ptr< endpoint endpoint,
void const *  packed_rkey_buffer 
)

Construct a new remote memory handle object. All subsequent remote memory access will happen on the given endpoint.

Parameters
endpointUCX endpoint
packed_rkey_bufferPacked remote key buffer received from remote peer

◆ remote_memory_handle() [2/2]

ucxpp::remote_memory_handle::remote_memory_handle ( remote_memory_handle &&  other)

Construct a new remote memory handle object.

Parameters
otherAnother remote memory handle to move from

Member Function Documentation

◆ atomic_add()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_add ( uint64_t  remote_addr,
T const &  delta 
) const
inline

Atomically add to a value in the remote memory region.

Template Parameters
TThe type of the value to add, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to add to
deltaThe value to add
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion.

◆ atomic_and()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_and ( uint64_t  remote_addr,
T const &  bits 
) const
inline

Atomically AND a value in the remote memory region.

Template Parameters
TThe type of the value to AND, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to AND to
deltaThe other operand of the AND operation
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion.

◆ atomic_compare_swap()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_compare_swap ( uint64_t  raddr,
T const &  expected,
T &  desired_and_old 
) const
inline

Atomically compare and swap a value in the remote memory region.

Template Parameters
TThe type of the value to swap, should be of 4 bytes or 8 bytes long
Parameters
raddrThe remote address to swap
expectedThe expected value to compare against
desired_and_oldA reference to a variable to store the desired new value and the old value swapped out
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion. The old value is placed in desired_and_old

◆ atomic_fetch_add()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_fetch_add ( uint64_t  remote_addr,
T const &  delta,
T &  old_value 
) const
inline

Atomically fetch and add a value to the remote memory region.

Template Parameters
TThe type of the value to add, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to add to
deltaThe value to add
old_valueA reference to a variable to store the old value
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion. The old value is placed in old_value

◆ atomic_fetch_and()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_fetch_and ( uint64_t  remote_addr,
T const &  bits,
T &  old_value 
) const
inline

Atomically fetch and AND a value to the remote memory region.

Template Parameters
TThe type of the value to AND, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to AND to
deltaThe other operand of the AND operation
old_valueA reference to a variable to store the old value
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion. The old value is placed in old_value

◆ atomic_fetch_or()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_fetch_or ( uint64_t  remote_addr,
T const &  bits,
T &  old_value 
) const
inline

Atomically fetch and OR a value to the remote memory region.

Template Parameters
TThe type of the value to OR, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to OR to
deltaThe other operand of the OR operation
old_valueA reference to a variable to store the old value
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion. The old value is placed in old_value

◆ atomic_fetch_xor()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_fetch_xor ( uint64_t  remote_addr,
T const &  bits,
T &  old_value 
) const
inline

Atomically fetch and XOR a value to the remote memory region.

Template Parameters
TThe type of the value to XOR, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to XOR to
deltaThe other operand of the XOR operation
old_valueA reference to a variable to store the old value
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion. The old value is placed in old_value

◆ atomic_or()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_or ( uint64_t  remote_addr,
T const &  bits 
) const
inline

Atomically OR to a value in the remote memory region.

Template Parameters
TThe type of the value to OR, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to OR to
deltaThe other operand of the OR operation
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion.

◆ atomic_swap()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_swap ( uint64_t  remote_addr,
T const &  new_value,
T &  old_value 
) const
inline

Atomically swap a value in the remote memory region.

Template Parameters
TThe type of the value to swap, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to swap
new_valueThe new value to swap in
old_valueA reference to a variable to store the old value
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion. The old value is placed in old_value

◆ atomic_xor()

template<class T >
rma_atomic_awaitable< T > ucxpp::remote_memory_handle::atomic_xor ( uint64_t  remote_addr,
T const &  bits 
) const
inline

Atomically XOR a value to the remote memory region.

Template Parameters
TThe type of the value to XOR, should be of 4 bytes or 8 bytes long
Parameters
remote_addrThe remote address to XOR to
deltaThe other operand of the XOR operation
Returns
rma_atomic_awaitable<T> A coroutine that returns upon completion. The old value is placed in old_value

◆ endpoint_ptr()

std::shared_ptr< endpoint > ucxpp::remote_memory_handle::endpoint_ptr ( ) const

Get the memory region's endpoint object.

Returns
std::shared_ptr<endpoint> The memory region's endpoint object

◆ get()

rma_get_awaitable ucxpp::remote_memory_handle::get ( void *  buffer,
size_t  length,
uint64_t  remote_addr 
) const

Read from the remote memory region.

Parameters
bufferLocal buffer to read into
lengthLength of the buffer
remote_addrRemote address to read from
Returns
rma_get_awaitable A coroutine that returns upon completion

◆ handle()

ucp_rkey_h ucxpp::remote_memory_handle::handle ( ) const

Get the native UCX rkey handle.

Returns
ucp_rkey_h The native UCX rkey handle

◆ put()

rma_put_awaitable ucxpp::remote_memory_handle::put ( void const *  buffer,
size_t  length,
uint64_t  remote_addr 
) const

Write to the remote memory region.

Parameters
bufferLocal buffer to write from
lengthLength of the buffer
remote_addrRemote address to write to
Returns
rma_put_awaitable A coroutine that returns upon completion

◆ read()

rma_get_awaitable ucxpp::remote_memory_handle::read ( void *  buffer,
size_t  length,
uint64_t  remote_addr 
) const

◆ write()

rma_put_awaitable ucxpp::remote_memory_handle::write ( void const *  buffer,
size_t  length,
uint64_t  remote_addr 
) const


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