hololink::module::ReceiverMemoryDescriptor
hololink::module::ReceiverMemoryDescriptor
A page-aligned region of GPU-accessible memory that a receiver writes incoming data into, usually on GPU directly accessible memory.
The memory is not initialized. It is released when the descriptor is destroyed; the CUDA context it was created with must still be valid at that point. Because the memory is released with the descriptor, anything still using the address returned by get() must be finished first.
Constructors
ReceiverMemoryDescriptor
Allocate the memory.
Initializes the CUDA driver if necessary and makes context the current CUDA context of the calling thread.
Throws: std::overflow_error if size is too large to allocate with page alignment.
Throws: std::runtime_error if a CUDA call fails, for example if the allocation cannot be satisfied.
Parameters
CUDA context in which to allocate. The address returned by get() is valid in this context.
Number of usable bytes required, starting at get(). It is not rounded up, so callers that need whole pages must do so themselves.
Which allocator to use; see Placement.
Methods
get
The start of the usable memory, as a GPU device address.
The address is aligned to the system page size, and at least size bytes (as given to the constructor) are available from it. It is constant for the life of the descriptor.
Returns: The device pointer.
Types
Placement
Where the memory comes from.