Allocator class for different kinds of CUDA related memory. More...
#include <PxCudaMemoryManager.h>
Public Member Functions | |
virtual PxCudaBuffer * | alloc (const PxCudaBufferType &type, size_t size, NV_ALLOC_INFO_PARAMS_DECL(NULL, 0, NULL, UNASSIGNED))=0 |
Allocate memory of given type and size. Returns a CudaBuffer if successful. Returns NULL if failed. More... | |
virtual PxCudaBufferPtr | alloc (PxCudaBufferMemorySpace::Enum memorySpace, size_t size, NV_ALLOC_INFO_PARAMS_DECL(NULL, 0, NULL, UNASSIGNED))=0 |
Basic heap allocator without PxCudaBuffer. More... | |
virtual bool | free (PxCudaBufferMemorySpace::Enum memorySpace, PxCudaBufferPtr addr)=0 |
Basic heap deallocator without PxCudaBuffer. More... | |
virtual bool | realloc (PxCudaBufferMemorySpace::Enum memorySpace, PxCudaBufferPtr addr, size_t size, NV_ALLOC_INFO_PARAMS_DECL(NULL, 0, NULL, UNASSIGNED))=0 |
Basic heap realloc without PxCudaBuffer. More... | |
virtual void | getStats (const PxCudaBufferType &type, PxCudaMemoryManagerStats &outStats)=0 |
Retrieve stats for the memory of given type. See PxCudaMemoryManagerStats. More... | |
virtual bool | reserve (const PxCudaBufferType &type, size_t size)=0 |
virtual bool | setPageSize (const PxCudaBufferType &type, size_t size)=0 |
virtual bool | setMaxMemorySize (const PxCudaBufferType &type, size_t size)=0 |
virtual size_t | getBaseSize (const PxCudaBufferType &type)=0 |
Returns the base size. The base memory block stays persistently allocated over the SDKs life time. More... | |
virtual size_t | getPageSize (const PxCudaBufferType &type)=0 |
Returns the currently set page size. The memory grows and shrinks in blocks of size (2^n pageSize) More... | |
virtual size_t | getMaxMemorySize (const PxCudaBufferType &type)=0 |
Returns the upper limit until which the manager is allowed to allocate additional pages from the CUDA driver. More... | |
virtual PxCudaBufferPtr | getMappedPinnedPtr (PxCudaBufferPtr hostPtr)=0 |
Get device mapped pinned host mem ptr. Operation only valid for memory space PxCudaBufferMemorySpace::T_PINNED_HOST. More... | |
Protected Member Functions | |
virtual | ~PxCudaMemoryManager () |
protected destructor More... | |
Allocator class for different kinds of CUDA related memory.
|
inlineprotectedvirtual |
protected destructor
|
pure virtual |
Allocate memory of given type and size. Returns a CudaBuffer if successful. Returns NULL if failed.
|
pure virtual |
Basic heap allocator without PxCudaBuffer.
|
pure virtual |
Basic heap deallocator without PxCudaBuffer.
|
pure virtual |
Returns the base size. The base memory block stays persistently allocated over the SDKs life time.
|
pure virtual |
Get device mapped pinned host mem ptr. Operation only valid for memory space PxCudaBufferMemorySpace::T_PINNED_HOST.
|
pure virtual |
Returns the upper limit until which the manager is allowed to allocate additional pages from the CUDA driver.
|
pure virtual |
Returns the currently set page size. The memory grows and shrinks in blocks of size (2^n pageSize)
|
pure virtual |
Retrieve stats for the memory of given type. See PxCudaMemoryManagerStats.
|
pure virtual |
Basic heap realloc without PxCudaBuffer.
|
pure virtual |
Ensure that a given amount of free memory is available. Triggers CUDA allocations in size of (2^n * pageSize) if necessary. Returns false if page allocations failed.
|
pure virtual |
Set the upper limit until which pages of a given memory type can be allocated. Reducing the max when it is already hit does not shrink the memory until it is deallocated by releasing the buffers which own the memory.
|
pure virtual |
Set the page size. The managed memory grows by blocks 2^n * pageSize. Page allocations trigger CUDA driver allocations, so the page size should be reasonably big. Returns false if input size was invalid, i.e. not power of two. Default is 2 MB.