PSFEstimationwithCPSO
|
The class is a factory for the OpenCl contexts, command queues and kernels. It is also a pool manager for the queues created. More...
#include <cl_factory.hpp>
Static Public Member Functions | |
static void | startup () |
Prepare this factory for the use. | |
static void | startup (vector< int > *devices) |
Prepare this factory for the use, filtering only the devices specified by the vector. | |
static void | shutdown () |
Finalize this factory. | |
static clQueue * | getQueue () |
Get the next command queue available for the use. If none is available on the pool, just create one on the next available context. | |
static void | disposeQueue (clQueue *clqueue) |
Dispose the clQueue instance, putting it back to the pool. | |
static void | getDeviceName (clQueue *queues, char *deviceName, int nameSize) |
Get the device name from the queue provided. | |
static int | getNumAvailableContexts () |
Return the number of contexts available for use. | |
static int | getNumAvailableDevices () |
Return the number of devices available for use. |
The class is a factory for the OpenCl contexts, command queues and kernels. It is also a pool manager for the queues created.
It manages all the initialization and finalization procedures, providing a clQueue instance entirely ready for the use. Every queue is created on a distinct device (a context here uses only a single device) and the devices are selected in round-robin sequence.
void clFactory::disposeQueue | ( | clQueue * | clqueue | ) | [static] |
void clFactory::getDeviceName | ( | clQueue * | queue, |
char * | deviceName, | ||
int | nameSize | ||
) | [static] |
Get the device name from the queue provided.
queue | The queue. |
deviceName | A pointer where to put the device name. |
nameSize | The memory size where the pointer points to. |
int clFactory::getNumAvailableContexts | ( | ) | [static] |
Return the number of contexts available for use.
int clFactory::getNumAvailableDevices | ( | ) | [static] |
Return the number of devices available for use.
clQueue * clFactory::getQueue | ( | ) | [static] |
Get the next command queue available for the use. If none is available on the pool, just create one on the next available context.
void clFactory::shutdown | ( | ) | [static] |
Finalize this factory.
It's mandatory to call this method after all the work is done!
void clFactory::startup | ( | vector< int > * | _devices | ) | [static] |
Prepare this factory for the use, filtering only the devices specified by the vector.
It's mandatory to call this method Before calling any other method of this factory.
_devices | The list of devices to be used. |
void clFactory::startup | ( | ) | [static] |
Prepare this factory for the use.
It's mandatory to call this method Before calling any other method of this factory.