PxCudaContextManagerDesc

Defined in include/cudamanager/PxCudaContextManager.h

class PxCudaContextManagerDesc

Descriptor used to create a PxCudaContextManager.

Public Functions

inline PxCudaContextManagerDesc()

Public Members

CUcontext *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.

void *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.

const char *appGUID

Application-specific GUID.

If your application employs PhysX modules that use CUDA you need to use a GUID so that patches for new architectures can be released for your game.You can obtain a GUID for your application from Nvidia.

PxDeviceAllocatorCallback *deviceAllocator

Application-specific device memory allocator.

the application can implement an device memory allocator, which inherites PxDeviceAllocatorCallback, and pass that to the PxCudaContextManagerDesc. The SDK will use that allocator to allocate device memory instead of using the defaul CUDA device memory allocator.