Qrack  1.7
General classical-emulating-quantum development framework
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Qrack::OCLEngine Class Reference

"Qrack::OCLEngine" manages the single OpenCL context. More...

#include <oclengine.hpp>

Collaboration diagram for Qrack::OCLEngine:
Collaboration graph
[legend]

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< DeviceContextPtrGetDeviceContextPtrVector ()
 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 OCLEngineInstance ()
 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 &)
 
OCLEngineoperator= (OCLEngine const &rhs)
 
void InitOCL ()
 
unsigned long PowerOf2LessThan (unsigned long number)
 

Private Attributes

std::vector< DeviceContextPtrall_device_contexts
 
DeviceContextPtr default_device_context
 

Static Private Attributes

static OCLEnginem_pInstance = NULL
 

Detailed Description

"Qrack::OCLEngine" manages the single OpenCL context.

Constructor & Destructor Documentation

Qrack::OCLEngine::OCLEngine ( )
private
Qrack::OCLEngine::OCLEngine ( OCLEngine const &  )
private

Member Function Documentation

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

int Qrack::OCLEngine::GetDeviceCount ( )
inline

Get the count of devices in the current list.

void Qrack::OCLEngine::InitOCL ( )
private
OCLEngine * Qrack::OCLEngine::Instance ( )
static

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

OCLEngine & Qrack::OCLEngine::operator= ( OCLEngine const &  rhs)
private
unsigned long Qrack::OCLEngine::PowerOf2LessThan ( unsigned long  number)
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.

Member Data Documentation

std::vector<DeviceContextPtr> Qrack::OCLEngine::all_device_contexts
private
DeviceContextPtr Qrack::OCLEngine::default_device_context
private
OCLEngine * Qrack::OCLEngine::m_pInstance = NULL
staticprivate

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