OCLEngine

Defined in common/oclengine.hpp.

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

class 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.

static inline 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

Warning

doxygenfunction: Unable to resolve function “Qrack::OCLEngine::GetDeviceContextPtr” with arguments (const int&) in doxygen xml output for project “qrack” from directory: /tmp/qrack/doc/xml. Potential matches:

- DeviceContextPtr GetDeviceContextPtr(const int64_t &dev = -1)
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.

inline 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.