cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::memory::ipc::imported_ptr_t Class Reference

A smart-pointer-like class for memory obtained via inter-process communication. More...

#include <ipc.hpp>

Public Member Functions

 imported_ptr_t (const imported_ptr_t &other)=delete
 
imported_ptr_toperator= (const imported_ptr_t &other)=delete
 
imported_ptr_toperator= (imported_ptr_t &&other) noexcept
 
 imported_ptr_t (imported_ptr_t &&other) noexcept=default
 
template<typename T = void>
T * get () const noexcept
 
bool is_owning () const noexcept
 

Friends

imported_ptr_t wrap (void *ptr, bool owning) noexcept
 Construct an instance of our wrapper class for IPC-imported memory from a raw pointer to the mapping.
 

Detailed Description

A smart-pointer-like class for memory obtained via inter-process communication.

This RAII wrapper class maps memory in the current process' address space on construction, and unmaps it on destruction, using a CUDA IPC handle.

Template Parameters
theelement type in the stretch of IPC-shared memory

Member Function Documentation

◆ get()

template<typename T = void>
T* cuda::memory::ipc::imported_ptr_t::get ( ) const
inlinenoexcept
Returns
the unwrapped, raw, pointer to the imported memory

◆ is_owning()

bool cuda::memory::ipc::imported_ptr_t::is_owning ( ) const
inlinenoexcept
Returns
true if this object is charged with unmapping the imported memory upon destruction

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