PSFEstimationwithCPSO
clFactory Class Reference

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>

List of all members.

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

Detailed Description

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.


Member Function Documentation

void clFactory::disposeQueue ( clQueue clqueue) [static]

Dispose the clQueue instance, putting it back to the pool.

Parameters:
clqueueThe clQueue instance to be released.
void clFactory::getDeviceName ( clQueue queue,
char *  deviceName,
int  nameSize 
) [static]

Get the device name from the queue provided.

Parameters:
queueThe queue.
deviceNameA pointer where to put the device name.
nameSizeThe memory size where the pointer points to.
int clFactory::getNumAvailableContexts ( ) [static]

Return the number of contexts available for use.

Returns:
The number of contexts available for use.
int clFactory::getNumAvailableDevices ( ) [static]

Return the number of devices available for use.

Returns:
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.

Returns:
The clQueue instance containing the command queue and all its configuration.
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.

Parameters:
_devicesThe 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.


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