Click or drag to resize
SoCudaApi Class

CUDA access API.

Inheritance Hierarchy
SystemObject
  OIV.InventorSoNetBase
    OIV.Inventor.CudaSoCudaApi

Namespace: OIV.Inventor.Cuda
Assembly: OIV.Inventor.Cuda (in OIV.Inventor.Cuda.dll) Version: 9.9.36.0 (9.9.36.0)
Syntax
public sealed class SoCudaApi : SoNetBase

The SoCudaApi type exposes the following members.

Methods
  NameDescription
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberLaunch

Launch the specified kernel function.

Public methodStatic memberResetParameters

This function resets the internal list of parameters for the specific list.

Public methodStatic memberSetBlockShape

This function specifies the thread blocks shape.

Public methodStatic memberSetParameter(SoCudaHandle, SoCudaBufferObject)

This function adds a SoCudaBufferObject parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, Byte)

This function adds an unsigned char parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, Double)

This function adds a double parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, Int16)

This function adds a short parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, Int32)

This function adds an integer parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, IntPtr)

This function adds a pointer parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, SByte)

This function adds a char parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, Single)

This function adds a float parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, UInt16)

This function adds an unsigned short parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetParameter(SoCudaHandle, UInt32)

This function adds an unsigned integer parameter to the list of parameters sent to the kernel by launch function.

Public methodStatic memberSetSharedMemorySize

This function sets the size of the shared memory allocated for each thread block when the kernel is launched.

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

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.

USAGE

You can call the provided functions with a valid handle created by the SoCuda class.

EXAMPLE

...

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();

See Also