Qrack
1.7
General classical-emulating-quantum development framework
|
"Qrack::OCLEngine" manages the single OpenCL context. More...
#include <oclengine.hpp>
Public Member Functions | |
DeviceContextPtr | GetDeviceContextPtr (const int &dev=-1) |
Get a pointer one of the available OpenCL contexts, by its index in the list of all contexts. More... | |
std::vector< DeviceContextPtr > | GetDeviceContextPtrVector () |
Get the list of all available devices (and their supporting objects). More... | |
void | SetDeviceContextPtrVector (std::vector< DeviceContextPtr > vec, DeviceContextPtr dcp=nullptr) |
Set the list of DeviceContextPtr object available for use. More... | |
int | GetDeviceCount () |
Get the count of devices in the current list. More... | |
void | SetDefaultDeviceContext (DeviceContextPtr dcp) |
Pick a default device, for QEngineOCL instances that don't specify a preferred device. More... | |
Static Public Member Functions | |
static OCLEngine * | Instance () |
Get a pointer to the Instance of the singleton. (The instance will be instantiated, if it does not exist yet.) More... | |
Private Member Functions | |
OCLEngine () | |
OCLEngine (OCLEngine const &) | |
OCLEngine & | operator= (OCLEngine const &rhs) |
void | InitOCL () |
unsigned long | PowerOf2LessThan (unsigned long number) |
Private Attributes | |
std::vector< DeviceContextPtr > | all_device_contexts |
DeviceContextPtr | default_device_context |
Static Private Attributes | |
static OCLEngine * | m_pInstance = NULL |
"Qrack::OCLEngine" manages the single OpenCL context.
|
private |
|
private |
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).
|
inline |
Get the count of devices in the current list.
|
private |
|
static |
Get a pointer to the Instance of the singleton. (The instance will be instantiated, if it does not exist yet.)
|
private |
void Qrack::OCLEngine::SetDefaultDeviceContext | ( | DeviceContextPtr | dcp | ) |
Pick a default device, for QEngineOCL instances that don't specify a preferred device.
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.
|
private |
|
private |
|
staticprivate |