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

Allocator for CUDA pinned host memory. More...

#include <bounce_buffer.hpp>

Public Member Functions

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

Detailed Description

Allocator for CUDA pinned host memory.

Uses cudaMemHostAlloc to allocate pinned (page-locked) host memory that can be efficiently transferred to/from GPU device memory. The allocation is only guaranteed to be aligned to "at least 256 bytes". It is NOT guaranteed to be page aligned.

Note
Do NOT use with Direct I/O - lacks page alignment guarantee

Definition at line 48 of file bounce_buffer.hpp.

Member Function Documentation

◆ allocate()

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

Allocate CUDA pinned host memory.

Parameters
sizeRequested size in bytes
Returns
Pointer to allocated pinned memory

◆ deallocate()

void kvikio::CudaPinnedAllocator::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: