OCLEngine

Defined in common/oclengine.hpp.

This provides a basic interface with a wide-ranging set of functionality.

class Qrack::OCLEngine

“Qrack::OCLEngine” manages the single OpenCL context.

Creating an OCLEngine

OCLEngine is a singleton class that manages all OpenCL devices and supported objects, for use in QEngineOCL and QEngineOCLMulti.

OCLEngine *Qrack::OCLEngine::Instance()

Get a pointer to the Instance of the singleton. (The instance will be instantiated, if it does not exist yet.)

Configuration Methods

DeviceContextPtr Qrack::OCLEngine::GetDeviceContextPtr(const int &dev = -1)

Get a pointer one of the available OpenCL contexts, by its index in the list of all contexts.

“Qrack::OCLEngine” manages the single OpenCL context

std::vector<DeviceContextPtr> Qrack::OCLEngine::GetDeviceContextPtrVector()

Get the list of all available devices (and their supporting objects).

void Qrack::OCLEngine::SetDeviceContextPtrVector(std::vector<DeviceContextPtr> vec, DeviceContextPtr dcp = nullptr)

Set the list of DeviceContextPtr object available for use.

If one takes the result of GetDeviceContextPtrVector(), trims items from it, and sets it with this method, (at initialization, before any QEngine objects depend on them,) all resources associated with the removed items are freed.

int Qrack::OCLEngine::GetDeviceCount()

Get the count of devices in the current list.

void Qrack::OCLEngine::SetDefaultDeviceContext(DeviceContextPtr dcp)

Pick a default device, for QEngineOCL instances that don’t specify a preferred device.