SoOpenCLDevice Class Reference
[OpenCL device]

VSG extension OpenCL device management class More...

#include <Inventor/devices/SoOpenCLDevice.h>

Inheritance diagram for SoOpenCLDevice:
SoDevice

List of all members.

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 SoOpenCLDevicefindFirstAvailableDevice ()
static SoOpenCLDevicegetDevice (int index)
static unsigned int getDevicesCount ()

Friends

class SoDevice
std::ostream & operator<< (std::ostream &os, const SoOpenCLDevice &dev)

Detailed Description

VSG extension 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.

SEE ALSO

SoOpenCL, SoOpenCLApi, SoOpenCLContext, SoOpenCLBufferObject, SoCpuDevice, SoCudaDevice, SoGLDevice

See related examples:

DevicesProperties


Member Enumeration Documentation

The OpenCL device type.

The type can be a combination of those values.

Enumerator:
DEVICE_CPU 
DEVICE_GPU 
DEVICE_ACCELERATOR 
DEVICE_DEFAULT 

Member Function Documentation

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.

Returns:
The supported OpenCL version.
static SoOpenCLDevice* SoOpenCLDevice::getDevice ( int  index  )  [static]

Returns the SoOpenCLDevice indicated by index.

Parameters:
index the index of the SoOpenCLDevice.

Reimplemented from SoDevice.

virtual SbString SoOpenCLDevice::getDeviceName (  )  const [virtual]

Returns the device name.

Returns:
The device name.

Implements SoDevice.

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.

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.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const SoOpenCLDevice dev 
) [friend]

Prints information about this device.

friend class SoDevice [friend]

The documentation for this class was generated from the following file:

Open Inventor by FEI reference manual, generated on 19 Aug 2019
Copyright © FEI S.A.S. All rights reserved.
http://www.openinventor.com/