OpenCL device management class
More...
#include <Inventor/devices/SoOpenCLDevice.h>
Public Types | |
| enum | OpenCLDeviceType { DEVICE_CPU = 1, DEVICE_GPU = 2, DEVICE_ACCELERATOR = 4, DEVICE_DEFAULT = 8 } |
Public Member Functions | |
| OpenCLDeviceType | getDeviceType () const |
| SbString | getDeviceTypeString () const |
| float | getComputingVersion () const |
| virtual unsigned long long | getTotalMemory () const |
| virtual unsigned long long | getAvailableMemory () const |
| virtual unsigned int | getLogicalUnits () const |
| virtual SbString | getDriverVersion () const |
| virtual SbString | getDeviceName () const |
| cl_device_id | getOpenCLDeviceId () const |
| void | getMaxWorkItemSizes (int &x, int &y, int &z) const |
| unsigned long | getMaxWorkGroupSize () const |
| unsigned long | getMaxMemoryAllocationSize () const |
Static Public Member Functions | |
| static void | init () |
| static bool | isInitialized () |
| static void | finish () |
| static SoOpenCLDevice * | findFirstAvailableDevice () |
| static SoOpenCLDevice * | getDevice (int index) |
| static unsigned int | getDevicesCount () |
Friends | |
| class | SoDevice |
| std::ostream & | operator<< (std::ostream &os, const SoOpenCLDevice &dev) |
OpenCL device management class
This class provides functions to discover, and query information about, OpenCL-enabled devices (CPU, GPU, etc) available in the system using the standard OpenCL API. You can query the memory available on a device, the compute capability, etc.
Please see SoDevice for general information about the device classes.
NOTE: Before using these devices the application must initialize OpenCL by calling SoOpenCL::init.
SoOpenCL, SoOpenCLApi, SoOpenCLContext, SoOpenCLBufferObject, SoCpuDevice, SoCudaDevice, SoGLDevice
| static SoOpenCLDevice* SoOpenCLDevice::findFirstAvailableDevice | ( | ) | [static] |
Returns the first available OpenCL device in the system.
Note the result is always null if SoOpenCL::init() has not been called.
| static void SoOpenCLDevice::finish | ( | ) | [static] |
Unregister the class and previously registered devices.
| virtual unsigned long long SoOpenCLDevice::getAvailableMemory | ( | ) | const [virtual] |
Returns the currently available memory on this device in bytes.
Implements SoDevice.
| float SoOpenCLDevice::getComputingVersion | ( | ) | const |
Returns the version of OpenCL supported by this device.
| static SoOpenCLDevice* SoOpenCLDevice::getDevice | ( | int | index | ) | [static] |
Returns the SoOpenCLDevice indicated by index.
| index | the index of the SoOpenCLDevice. |
Reimplemented from SoDevice.
| virtual SbString SoOpenCLDevice::getDeviceName | ( | ) | const [virtual] |
| static unsigned int SoOpenCLDevice::getDevicesCount | ( | ) | [static] |
Returns the number of OpenCL capable devices in the system.
Note the result is always null if SoOpenCL::init() has not been called.
Reimplemented from SoDevice.
| OpenCLDeviceType SoOpenCLDevice::getDeviceType | ( | ) | const |
Returns the device type, or a binary combination of device type.
| SbString SoOpenCLDevice::getDeviceTypeString | ( | ) | const |
Returns a string which describes the device type combination.
| virtual SbString SoOpenCLDevice::getDriverVersion | ( | ) | const [virtual] |
Returns the driver version of this device.
Implements SoDevice.
| virtual unsigned int SoOpenCLDevice::getLogicalUnits | ( | ) | const [virtual] |
Returns the number of logical (computing) units of this device (i.e.
the number of cores of this device).
Implements SoDevice.
| unsigned long SoOpenCLDevice::getMaxMemoryAllocationSize | ( | ) | const |
Returns the maximum size (in bytes) of a buffer allocated on the device.
| unsigned long SoOpenCLDevice::getMaxWorkGroupSize | ( | ) | const |
Returns the maximum group size for this device.
| void SoOpenCLDevice::getMaxWorkItemSizes | ( | int & | x, | |
| int & | y, | |||
| int & | z | |||
| ) | const |
Returns the maximum grid size for this device.
| cl_device_id SoOpenCLDevice::getOpenCLDeviceId | ( | ) | const |
Returns the OpenCL device ID.
| virtual unsigned long long SoOpenCLDevice::getTotalMemory | ( | ) | const [virtual] |
Returns the total memory of this device in bytes.
Implements SoDevice.
| static void SoOpenCLDevice::init | ( | ) | [static] |
Detect and register available OpenCL devices.
| static bool SoOpenCLDevice::isInitialized | ( | ) | [static] |
Returns true if module is currently initialized.
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const SoOpenCLDevice & | dev | |||
| ) | [friend] |
Prints information about this device.
friend class SoDevice [friend] |