Cuda module class More...
#include <Inventor/cuda/SoCuda.h>
Classes | |
struct | SoCudaModule |
Defines a CUDA module. | |
Public Types | |
enum | SoCudaError { SO_CUDA_SUCCESS, SO_CUDA_MODULE_LOAD_ERROR, SO_CUDA_MODULE_FUNCTION_ERROR, SO_CUDA_INVALID_PARAMETER, SO_CUDA_INVALID_CONTEXT } |
Static Public Member Functions | |
static void | init () |
static void | finish () |
static bool | isInitialized () |
static SbBool | isAvailable () |
static SoCudaError | loadBinaryModule (const SbString &filename, const SbString &moduleName) |
static SoCudaError | loadBinaryModule (const void *moduleData, size_t dataSize, const SbString &moduleName) |
static SoCudaHandle * | findFunction (const SbString &moduleName, const SbString &functionName) |
static SoCudaError | findFunction (SoCudaHandle *handle, const SbString &moduleName, const SbString &functionName) |
The Open Inventor CUDA module provides a set of useful functions for CUDA development including memory management, module handling and device management functions.
NOTE: The classes in this module do not exist in Open Inventor 10.0 and later.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:
// OpenInventor Initialization ... 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();
SoCudaApi, SoCudaContext, SoCudaDevice, SoCudaBufferObject, SoCudaArithmetic, SoCudaConversion, SoCudaConvolution, SoCudaSeismic
HelloCUDA, SimpleCUDAKernel, ComputeSlice, CudaMarchingCubes, LDMMandelBulb
enum SoCuda::SoCudaError |
This enum defines the possible errors returned by the Cuda API.
SO_CUDA_SUCCESS |
No error, the operation is a success. |
SO_CUDA_MODULE_LOAD_ERROR |
Error: The specified module cannot be loaded. |
SO_CUDA_MODULE_FUNCTION_ERROR |
Error: The specified function cannot be loaded. |
SO_CUDA_INVALID_PARAMETER |
Error: One of the specified paramaters is invalid. |
SO_CUDA_INVALID_CONTEXT |
This error indicates that there is no valid CUDA context to perform the requested operation.
|
static SoCudaError SoCuda::findFunction | ( | SoCudaHandle * | handle, | |
const SbString & | moduleName, | |||
const SbString & | functionName | |||
) | [static] |
This function resolves a specific function in a specified module.
handle | The handle which is updated with the function pointer. | |
moduleName | The name of the module which is supposed to contain the function. | |
functionName | The name of the function to resolve. |
static SoCudaHandle* SoCuda::findFunction | ( | const SbString & | moduleName, | |
const SbString & | functionName | |||
) | [static] |
This function resolves a specific function in a specified module.
moduleName | The name of the module which is supposed to contain the function. | |
functionName | The name of the function to resolve. |
static void SoCuda::finish | ( | ) | [static] |
Unload the CUDA module and free the data.
static void SoCuda::init | ( | ) | [static] |
Initialize the CUDA module.
static SbBool SoCuda::isAvailable | ( | ) | [static] |
This function indicates if CUDA is available on this platform.
static bool SoCuda::isInitialized | ( | ) | [static] |
Returns TRUE if module is currently initialized.
static SoCudaError SoCuda::loadBinaryModule | ( | const void * | moduleData, | |
size_t | dataSize, | |||
const SbString & | moduleName | |||
) | [static] |
This function loads a cubin from the specified buffer and register it in the list of modules.
moduleData | The cubin buffer. | |
dataSize | The size in bytes of the cubin buffer. | |
moduleName | The name of the module linked to the file. |
static SoCudaError SoCuda::loadBinaryModule | ( | const SbString & | filename, | |
const SbString & | moduleName | |||
) | [static] |
This function loads a cubin file and register it in the list of modules.
filename | The cubin filename. | |
moduleName | The name of the module linked to the file. |