PhysX SDK 3.2 API Reference: pxtask::CudaContextManagerDesc Class Reference

PhysX SDK 3.2 API

pxtask::CudaContextManagerDesc Class Reference

Descriptor used to create a CudaContextManager. More...

#include <PxCudaContextManager.h>

List of all members.


Public Member Functions

PX_INLINE CudaContextManagerDesc ()

Public Attributes

CUcontextctx
 The CUDA context to manage.
void * graphicsDevice
 D3D device pointer or OpenGl context handle.
CudaInteropMode::Enum interopMode
 The CUDA/Graphics interop mode of this context.
PxU32 memoryBaseSize [CudaBufferMemorySpace::COUNT]
 Size of persistent memory.
PxU32 memoryPageSize [CudaBufferMemorySpace::COUNT]
 Size of memory pages.
PxU32 maxMemorySize [CudaBufferMemorySpace::COUNT]
 Maximum size of memory that the memory manager will allocate.

Detailed Description

Descriptor used to create a CudaContextManager.

Constructor & Destructor Documentation

PX_INLINE pxtask::CudaContextManagerDesc::CudaContextManagerDesc (  )  [inline]

References NULL, and PX_MAX_U32.


Member Data Documentation

The CUDA context to manage.

If left NULL, the CudaContextManager 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 CudaContextManager at creation time (aka, it cannot be popped). The CudaContextManager 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 CudaContextManager, the context _must_ have either been created on the GPU ordinal returned by getSuggestedCudaDeviceOrdinal() or on your graphics device.

It is perfectly acceptable to allocate device or host pinned memory from the context outside the scope of the CudaMemoryManager, so long as you manage its eventual cleanup.

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.

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.

Maximum size of memory that the memory manager will allocate.

Size of persistent memory.

This memory is allocated up front and stays allocated until the CudaContextManager 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 ammount of memory your application will consume.

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.


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



Copyright © 2008-2012 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com