A wrapper for fi_close. More...
#include <lf_helper.hpp>
Public Member Functions | |
memory_region (size_t size) | |
Constructor Creates a buffer of the specified size and then calls the second constructor with the new buffer as an argument. More... | |
memory_region (char *buffer, size_t size) | |
Constructor Registers a memory region using the specified buffer and size. More... | |
uint64_t | get_key () const |
get_key Returns the key associated with the registered memory region, which is used to access the region. More... | |
memory_region (size_t size) | |
memory_region (char *buffer, size_t size) | |
uint32_t | get_rkey () const |
Public Attributes | |
char *const | buffer |
const size_t | size |
Private Member Functions | |
memory_region (size_t size, bool contiguous) | |
Private Attributes | |
std::unique_ptr< fid_mr, std::function< void(fid_mr *)> > | mr |
Smart pointer for managing the registered memory region. More... | |
std::unique_ptr< char[]> | allocated_buffer |
Smart pointer for managing the buffer the mr uses. More... | |
std::unique_ptr< ibv_mr, std::function< void(ibv_mr *)> > | mr |
Friends | |
class | endpoint |
class | task |
class | queue_pair |
A wrapper for fi_close.
A C++ wrapper for the IB Verbs ibv_mr struct.
The previous way this was done used a lambda and std::function, but that incurs the overhead of type-erasure A C++ wrapper for the libfabric fid_mr struct. Registers a memory region for the provided buffer on construction, and deregisters it on destruction.
Registers a memory region for the provided buffer on construction, and deregisters it on destruction. Instances of this class can only be created after global Verbs initialization has been run, since it depends on the global Verbs resources.
Definition at line 53 of file lf_helper.hpp.
rdma::memory_region::memory_region | ( | size_t | size | ) |
Constructor Creates a buffer of the specified size and then calls the second constructor with the new buffer as an argument.
Memory region constructors and member functions.
size | The size in bytes of the buffer to be associated with the memory region. |
Definition at line 203 of file lf_helper.cpp.
rdma::memory_region::memory_region | ( | char * | buffer, |
size_t | size | ||
) |
Constructor Registers a memory region using the specified buffer and size.
buffer | The allocated memory that will be registered. |
size | The size in bytes of the buffer to be associated with the memory region. |
Register the memory, use it to construct a smart pointer
Definition at line 207 of file lf_helper.cpp.
|
private |
Definition at line 525 of file verbs_helper.cpp.
rdma::memory_region::memory_region | ( | size_t | size | ) |
rdma::memory_region::memory_region | ( | char * | buffer, |
size_t | size | ||
) |
uint64_t rdma::memory_region::get_key | ( | ) | const |
get_key Returns the key associated with the registered memory region, which is used to access the region.
Definition at line 226 of file lf_helper.cpp.
uint32_t rdma::memory_region::get_rkey | ( | ) | const |
Definition at line 533 of file verbs_helper.cpp.
|
friend |
Definition at line 59 of file lf_helper.hpp.
|
friend |
Definition at line 45 of file verbs_helper.hpp.
|
friend |
Definition at line 60 of file lf_helper.hpp.
|
private |
Smart pointer for managing the buffer the mr uses.
Definition at line 57 of file lf_helper.hpp.
char *const rdma::memory_region::buffer |
Definition at line 88 of file lf_helper.hpp.
|
private |
Definition at line 41 of file verbs_helper.hpp.
|
private |
Smart pointer for managing the registered memory region.
Definition at line 55 of file lf_helper.hpp.
const size_t rdma::memory_region::size |
Definition at line 89 of file lf_helper.hpp.