SoCuda Class |
Cuda module class.
Namespace: OIV.Inventor.Cuda
The SoCuda type exposes the following members.
Name | Description | |
---|---|---|
![]() | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() ![]() | FindFunction(String, String) | This function resolves a specific function in a specified module. |
![]() ![]() | FindFunction(SoCudaHandle, String, String) | This function resolves a specific function in a specified module. |
![]() | GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | IsAvailable | This function indicates if CUDA is available on this platform. |
![]() ![]() | LoadBinaryModule | This function loads a cubin file and register it in the list of modules. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The Open Inventor CUDA module provides a set of useful functions for CUDA development including memory management, module handling and device management functions.
<font color="#0000FF">NOTE:</font> The classes in this module do not exist in Open Inventor 10.0 and later.
Memory management is provided by the SoCudaBufferObject class.
Module handling is included in the SoCuda class.
Device management functions are provided by the classes SoCudaContext and SoCudaDevice.
This module also provides built-in CUDA functions to quickly integrate in your application the CUDA functions useful to improve your computing performences.
The integrated modules are organized in different topics:
Conversion
Volumes
....
After the initialization of OpenInventor the CUDA module must be initialized using the init function. Before exiting the application the finish function must be called, in order to free all the memory allocated by the module.
After the initialization of the CUDA module there is no default CudaContext, so don't forget to create a CUDA context before performing any CUDA operation. See the class SoCudaContext for more information.
This example shows how to call a specific CUDA function.
... SoCuda.init(); SoCudaDevice* pMainDevice = SoCudaDevice.findFirstAvailableDevice(); if ( pMainDevice ) { SoCudaContext* pContext = new SoCudaContext( pMainDevice ); if ( pContext ) { pContext->bind(); SoCudaHandle* pHandle = SoCuda.findFunction( "ModuleName", "FunctionName" ); if ( pHandle ) { SoCudaApi.launch( pHandle, 10, 1 ); SoCudaApi.freeHandle( pHandle ); } pContext->unbind(); } } SoCuda.finish();