OpenCL module API
More...
#include <Inventor/OpenCL/SoOpenCL.h>
Classes | |
| struct | SoOpenCLModule |
| Defines a OpenCL module. | |
Public Types | |
| enum | SoOpenCLError { SO_OPENCL_SUCCESS, SO_OPENCL_MODULE_LOAD_ERROR, SO_OPENCL_MODULE_FUNCTION_ERROR, SO_OPENCL_INVALID_PARAMETER, SO_OPENCL_INVALID_CONTEXT } |
Static Public Member Functions | |
| static void | init () |
| static void | finish () |
| static bool | isInitialized () |
| static SbBool | isAvailable () |
| static SoOpenCLError | loadSourceModule (const SbString &filename, const SbString &moduleName) |
| static SoOpenCLHandle * | findFunction (const SbString &moduleName, const SbString &functionName) |
| static SoOpenCLError | findFunction (SoOpenCLHandle *handle, const SbString &moduleName, const SbString &functionName) |
OpenCL module API
The Inventor OpenCL module provides a set of useful functions for OpenCL development including memory managment, module handling and device managment functions.
NOTE: The classes in this module do not exist in Open Inventor 10.0 and later.This module also provides built-in OpenCL functions to quickly integrate in your application the OpenCL functions useful to improve your computing performences.
The integrated modules are organized in different topics:
// OpenInventor Initialization ... SoOpenCL::init(); SoOpenCLDevice* mainDevice = SoOpenCLDevice::findFirstAvailableDevice(); SoOpenCLContext* context = new SoOpenCLContext( mainDevice ); context->bind(); { SoOpenCLHandle* handle = SoOpenCL::findFunction( "ModuleName", "FunctionName" ); if ( handle ) { SoOpenCLApi::launch( handle, 10, 1 ); SoOpenCLApi::freeHandle( handle ); } } context->unbind(); SoOpenCL::finish();
SoOpenCLApi, SoOpenCLContext, SoOpenCLDevice, SoOpenCLBufferObject,
This enum defines the possible errors returned by the OpenCL API.
| SO_OPENCL_SUCCESS |
No error, the operation is a success. |
| SO_OPENCL_MODULE_LOAD_ERROR |
Error: The specified module cannot be loaded. |
| SO_OPENCL_MODULE_FUNCTION_ERROR |
Error: The specified function cannot be loaded. |
| SO_OPENCL_INVALID_PARAMETER |
Error: One of the specified paramaters is invalid. |
| SO_OPENCL_INVALID_CONTEXT |
This error indicates that there is no valid OpenCL context to perform the requested operation.
|
| static SoOpenCLError SoOpenCL::findFunction | ( | SoOpenCLHandle * | 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 SoOpenCLHandle* SoOpenCL::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 SoOpenCL::finish | ( | ) | [static] |
Unload the OpenCL module and free the data.
| static void SoOpenCL::init | ( | ) | [static] |
Initialize the OpenCL module.
| static SbBool SoOpenCL::isAvailable | ( | ) | [static] |
This function indicates if OpenCL is available on this platform.
| static bool SoOpenCL::isInitialized | ( | ) | [static] |
Returns TRUE if module is currently initialized.
| static SoOpenCLError SoOpenCL::loadSourceModule | ( | 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. |