JASPL  0.2
Just Another Signal Processing Library
taskqueuebase.h
1 #ifndef TASKQUEUEBASE_H
2 #define TASKQUEUEBASE_H
3 
4 //Header for this file
5 //
6 //C System-Headers
7 //
8 //C++ System headers
9 #include <iostream>
10 #include <memory>
11 //OpenCL Headers
12 #include <CL/cl.h>
13 #include <CL/cl.hpp>
14 //Boost Headers
15 //
16 //OpenMP Headers
17 //
18 //Project specific headers
19 #include "OpenCLBase/openclbase.h"
20 #include "TaskItem/taskitem.h"
21 #include "jTypeTraits/jtypetraits.h"
22 
23 namespace jaspl {
24 
25 namespace ocl {
26 
30 class TaskQueueBase : public OpenCLBase {
31 
32  friend class TaskItem;
33 
34  public:
47  TaskQueueBase( uint platform_number = 0, uint device_number = 0 );
48  virtual ~TaskQueueBase() = 0;
49 
56  void Execute();
57 
68  void AddTaskItem( TaskItem &item );
69 
80  bool RemoveTaskItem( TaskItem& item );
81 
86  void PrintContents();
87 
88  void ReknewSignal( cl::Buffer& processed_buff , size_t processed_bytes, size_t processed_size );
89 
90  protected:
91  std::list< TaskItem* > task_queue;
92 
93  cl::Buffer signal_input;
94  cl::Buffer output;
95 
96  size_t signal_size;
97  size_t signal_bytes;
98 
99  bool on_device = false;
100 
101 };
102 
103 }
104 
105 }
106 
107 #endif // TASKQUEUEBASE_H
void PrintContents()
Print all of the current elements in the queue in the order in which they will be executed...
void Execute()
Run all TaskItems that are currently loaded.
void AddTaskItem(TaskItem &item)
Add a new TaskItem into the TaskQueue.
bool RemoveTaskItem(TaskItem &item)
Remove a TaskItem from the queue (if it exists)
The fundamental structure underlying all OpenCL Functions.
Definition: taskqueuebase.h:30
Base class for every class that needs access to OpenCL Platforms, Contexts or Devices.
Definition: openclbase.h:31
TaskQueueBase(uint platform_number=0, uint device_number=0)
Build a new TaskQueueBase and implicitly initialize OpenCL Context, Platform etc. ...