My Project
poolschedule.hpp
1 
25 #ifndef _POOLSSCHEDULE_HPP_
26 #define _POOLSSCHEDULE_HPP_ 1
27 #include <vector>
28 #include <set>
29 #include <thread>
30 #include <cstdint>
31 #include "schedule.hpp"
32 #include "kernelcontainer.hpp"
33 
34 class Map;
35 namespace raft{
36  class kernel;
37 }
38 
39 
40 class pool_schedule : public Schedule
41 {
42 public:
49  pool_schedule( Map &map );
50 
55  virtual ~pool_schedule();
56 
62  virtual void start();
63 
64 protected:
72  virtual bool scheduleKernel( raft::kernel * const kernel );
73 
81  static bool container_min_input( kernel_container * const a,
82  kernel_container * const b );
83 
91  static bool container_min_output( kernel_container * const a,
92  kernel_container * const b );
93 
94 
101  const float diff_weight = .20;
105  const decltype( std::thread::hardware_concurrency() ) n_threads;
109  std::vector< std::thread* > pool;
113  std::vector< kernel_container* > container;
114 
115  std::size_t kernel_count = 0;
116  std::remove_reference< decltype( container.end() ) >::type container_it;
117 };
118 #endif /* END _POOLSSCHEDULE_HPP_ */
virtual ~pool_schedule()
Definition: poolschedule.cpp:49
virtual void start()
Definition: poolschedule.cpp:88
decltype(std::thread::hardware_concurrency()) const n_threads
Definition: poolschedule.hpp:105
static bool container_min_output(kernel_container *const a, kernel_container *const b)
Definition: poolschedule.cpp:157
pool_schedule(Map &map)
Definition: poolschedule.cpp:33
const float diff_weight
Definition: poolschedule.hpp:101
std::vector< kernel_container * > container
Definition: poolschedule.hpp:113
static bool container_min_input(kernel_container *const a, kernel_container *const b)
Definition: poolschedule.cpp:150
Definition: map.hpp:47
std::vector< std::thread * > pool
Definition: poolschedule.hpp:109
Definition: schedule.hpp:34
Definition: kernel.hpp:57
virtual bool scheduleKernel(raft::kernel *const kernel)
Definition: poolschedule.cpp:70
Definition: globalmap.cpp:3
Definition: kernelcontainer.hpp:36
Definition: poolschedule.hpp:40