Descriptor used to create a PxCudaContextManager. More...
#include <PxCudaContextManager.h>
Public Member Functions | |
PX_INLINE | PxCudaContextManagerDesc () |
Public Attributes | |
CUcontext * | ctx |
The CUDA context to manage. More... | |
void * | graphicsDevice |
D3D device pointer or OpenGl context handle. More... | |
PxCudaInteropMode::Enum | interopMode |
The CUDA/Graphics interop mode of this context. More... | |
PxU32 | memoryBaseSize [PxCudaBufferMemorySpace::COUNT] |
Size of persistent memory. More... | |
PxU32 | memoryPageSize [PxCudaBufferMemorySpace::COUNT] |
Size of memory pages. More... | |
PxU32 | maxMemorySize [PxCudaBufferMemorySpace::COUNT] |
Maximum size of memory that the memory manager will allocate. More... | |
Descriptor used to create a PxCudaContextManager.
|
inline |
References PxCudaBufferMemorySpace::COUNT, PxCudaInteropMode::NO_INTEROP, NULL, and PX_MAX_U32.
CUcontext* PxCudaContextManagerDesc::ctx |
The CUDA context to manage.
If left NULL, the PxCudaContextManager will create a new context. If graphicsDevice is also not NULL, this new CUDA context will be bound to that graphics device, enabling the use of CUDA/Graphics interop features.
If ctx is not NULL, the specified context must be applied to the thread that is allocating the PxCudaContextManager at creation time (aka, it cannot be popped). The PxCudaContextManager will take ownership of the context until the manager is released. All access to the context must be gated by lock acquisition.
If the user provides a context for the PxCudaContextManager, the context must have either been created on the GPU ordinal returned by PxGetSuggestedCudaDeviceOrdinal() or on your graphics device.
It is perfectly acceptable to allocate device or host pinned memory from the context outside the scope of the PxCudaMemoryManager, so long as you manage its eventual cleanup.
void* PxCudaContextManagerDesc::graphicsDevice |
D3D device pointer or OpenGl context handle.
Only applicable when ctx is NULL, thus forcing a new context to be created. In that case, the created context will be bound to this graphics device.
PxCudaInteropMode::Enum PxCudaContextManagerDesc::interopMode |
The CUDA/Graphics interop mode of this context.
If ctx is NULL, this value describes the nature of the graphicsDevice pointer provided by the user. Else it describes the nature of the context provided by the user.
PxU32 PxCudaContextManagerDesc::maxMemorySize[PxCudaBufferMemorySpace::COUNT] |
Maximum size of memory that the memory manager will allocate.
PxU32 PxCudaContextManagerDesc::memoryBaseSize[PxCudaBufferMemorySpace::COUNT] |
Size of persistent memory.
This memory is allocated up front and stays allocated until the PxCudaContextManager is released. Size is in bytes, has to be power of two and bigger than the page size. Set to 0 to only use dynamic pages.
Note: On Vista O/S and above, there is a per-memory allocation overhead to every CUDA work submission, so we recommend that you carefully tune this initial base memory size to closely approximate the amount of memory your application will consume.
PxU32 PxCudaContextManagerDesc::memoryPageSize[PxCudaBufferMemorySpace::COUNT] |
Size of memory pages.
The memory manager will dynamically grow and shrink in blocks multiple of this page size. Size has to be power of two and bigger than 0.