Class vart::Memory#
-
class Memory
This module is responsible for allocating and managing memory on the device.
Public Functions
Memory() - Constructor to allocate memory using implementation specific method based on input ‘type’.
- Parameters:
type – Enum class to specify which type of memory allocation method to use
size – Size of the buffer
mbank_idx – memory bank index on which memory needs to be allocated
device – Device handle to be used by implementation
Memory() - Constructor to create Memory instance using user provided data pointer.
- Parameters:
type – Enum class to specify which type of memory allocation method to use
data – user allocated buffer pointer
size – Size of the buffer
device – Device handle to be used by implementation
Memory() - Constructor for using user defined implementation.
- Parameters:
ptr – Pointer to user’s implementation instance
-
~Memory() = default#
-
const uint8_t *map(DataMapFlags map_flags)#
map() - Maps allocated memory to user space.
Only Memory allocated with XRT/CMA type of memory can be used with map()
- Parameters:
map_flags – Flag used to indicate mode of memory mapping
- Returns:
returns the virtual address
-
const std::shared_ptr<MemoryImplBase> &get_pimpl_handle() const#
get_pimpl_handle() - Retrieves pointer to Memory Implementation Base class
- Returns:
Returns a constant reference of pointer to implementation class.
-
std::shared_ptr<Device> get_device_handle() const#
get_device_handle() - Retrieves the device handle associated with memory allocation
- Returns:
Returns Device handle
-
size_t get_size()#
get_size() - gets the size of the allocated memory
- Returns:
returns the memory size
-
uint64_t get_physical_addr()#
get_physical_addr() - Retrieves the physical address of the allocated memory if memory type is XRT.
- Returns:
returns the physical address
Private Members
-
std::shared_ptr<MemoryImplBase> pimpl#