JASPL  0.2
Just Another Signal Processing Library
Public Member Functions | Protected Attributes | Friends | List of all members
jaspl::ocl::TaskQueueBase Class Referenceabstract

The fundamental structure underlying all OpenCL Functions. More...

#include <taskqueuebase.h>

Inheritance diagram for jaspl::ocl::TaskQueueBase:
Inheritance graph
[legend]
Collaboration diagram for jaspl::ocl::TaskQueueBase:
Collaboration graph
[legend]

Public Member Functions

 TaskQueueBase (uint platform_number=0, uint device_number=0)
 Build a new TaskQueueBase and implicitly initialize OpenCL Context, Platform etc. More...
 
void Execute ()
 Run all TaskItems that are currently loaded. More...
 
void AddTaskItem (TaskItem &item)
 Add a new TaskItem into the TaskQueue. More...
 
bool RemoveTaskItem (TaskItem &item)
 Remove a TaskItem from the queue (if it exists) More...
 
void PrintContents ()
 Print all of the current elements in the queue in the order in which they will be executed.
 
void ReknewSignal (cl::Buffer &processed_buff, size_t processed_bytes, size_t processed_size)
 
- Public Member Functions inherited from jaspl::ocl::OpenCLBase
 OpenCLBase (uint platform_number=0, uint device_number=0)
 Initialize OpenCL Objects Note that the Platform and Context are selected automatically: Platform is set to cl::Platform( 0 ) Context is set to cl::Context( device[ device_number ] ) More...
 

Protected Attributes

std::list< TaskItem * > task_queue
 
cl::Buffer signal_input
 
cl::Buffer output
 
size_t signal_size
 
size_t signal_bytes
 
bool on_device = false
 

Friends

class TaskItem
 

Additional Inherited Members

- Protected Member Functions inherited from jaspl::ocl::OpenCLBase
void SetUp (uint platform_number, uint device_number)
 
- Static Protected Attributes inherited from jaspl::ocl::OpenCLBase
static bool initalized = false
 
static std::vector< cl::Platform > all_platforms
 
static cl::Platform default_platform
 
static std::vector< cl::Device > all_devices
 
static cl::Device current_device
 
static cl::Context context
 
static cl::CommandQueue command_queue
 

Detailed Description

The fundamental structure underlying all OpenCL Functions.

Definition at line 30 of file taskqueuebase.h.

Constructor & Destructor Documentation

jaspl::ocl::TaskQueueBase::TaskQueueBase ( uint  platform_number = 0,
uint  device_number = 0 
)

Build a new TaskQueueBase and implicitly initialize OpenCL Context, Platform etc.

Parameters
device_numberNumber of the OpenCL device to use as described by cl::Platform::getDevices(CL_DEVICE_TYPE_ALL)

Note that this will be the device that every TaskItem will be executed on.

Definition at line 18 of file taskqueuebase.cpp.

Member Function Documentation

void jaspl::ocl::TaskQueueBase::AddTaskItem ( TaskItem item)

Add a new TaskItem into the TaskQueue.

Items added to the queue need not be unique, repeated TaskItems are allowed.

Parameters
itemThe TaskItem to be inserted into the queue.

Definition at line 42 of file taskqueuebase.cpp.

void jaspl::ocl::TaskQueueBase::Execute ( )

Run all TaskItems that are currently loaded.

Items are executed in the order in which they were added with AddTaskItem().

Definition at line 22 of file taskqueuebase.cpp.

bool jaspl::ocl::TaskQueueBase::RemoveTaskItem ( TaskItem item)

Remove a TaskItem from the queue (if it exists)

Parameters
itemThe TaskItem to be removed.

If item is not currently in the queue this function does nothing.

Returns
true if item was removed, false otherwise.

Definition at line 46 of file taskqueuebase.cpp.