SoCudaApi Class |
CUDA access API.
Namespace: OIV.Inventor.Cuda
The SoCudaApi type exposes the following members.
Name | Description | |
---|---|---|
![]() | Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | Launch | Launch the specified kernel function. |
![]() ![]() | ResetParameters | This function resets the internal list of parameters for the specific list. |
![]() ![]() | SetBlockShape | This function specifies the thread blocks shape. |
![]() ![]() | SetParameter(SoCudaHandle, SoCudaBufferObject) | This function adds a SoCudaBufferObject parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, Byte) | This function adds an unsigned char parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, Double) | This function adds a double parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, Int16) | This function adds a short parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, Int32) | This function adds an integer parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, IntPtr) | This function adds a pointer parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, SByte) | This function adds a char parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, Single) | This function adds a float parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, UInt16) | This function adds an unsigned short parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetParameter(SoCudaHandle, UInt32) | This function adds an unsigned integer parameter to the list of parameters sent to the kernel by launch function. |
![]() ![]() | SetSharedMemorySize | This function sets the size of the shared memory allocated for each thread block when the kernel is launched. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The SoCudaApi class provides functions to perform specific Cuda operations.
<font color="#0000FF">NOTE:</font> This class does not exist in Open Inventor 10.0 and later.
Most of the functions setup SoCudaHandle parameters, like the function arguments, block size, etc... Those parameters are used when the CUDA function is called.
You can call the provided functions with a valid handle created by the SoCuda class.
... 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.resetParameters( pHandle ); SoCudaApi.setParameter( pHandle, inputCudaBuffer ); SoCudaApi.setParameter( pHandle, outputCudaBuffer ); SoCudaApi.setParameter( pHandle, inputSize ); SoCudaApi.launch( pHandle, inputSize / 64, 1 ); SoCudaApi.freeHandle( pHandle ); } pContext->unbind(); } } SoCuda.finish();