Public Member Functions | List of all members
kvikio::PageAlignedAllocator Class Reference

Allocator for page-aligned host memory. More...

#include <bounce_buffer.hpp>

Public Member Functions

void * allocate (std::size_t size)
 Allocate page-aligned host memory. More...
 
void deallocate (void *buffer, std::size_t size)
 Deallocate memory previously allocated by this allocator. More...
 

Detailed Description

Allocator for page-aligned host memory.

Uses std::aligned_alloc to allocate host memory aligned to page boundaries (typically 4096 bytes). This allocator is suitable for Direct I/O operations that require page-aligned buffers but do not need CUDA context (i.e., host-to-host transfers only).

Definition at line 20 of file bounce_buffer.hpp.

Member Function Documentation

◆ allocate()

void* kvikio::PageAlignedAllocator::allocate ( std::size_t  size)

Allocate page-aligned host memory.

Parameters
sizeRequested size in bytes (will be rounded up to page boundary)
Returns
Pointer to allocated memory

◆ deallocate()

void kvikio::PageAlignedAllocator::deallocate ( void *  buffer,
std::size_t  size 
)

Deallocate memory previously allocated by this allocator.

Parameters
bufferPointer to memory to deallocate
sizeSize of the allocation (unused, for interface consistency)

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