RaftLib  0.3a
C++ Stream Processing Template Library
map.hpp
1 
20 #ifndef _MAP_HPP_
21 #define _MAP_HPP_ 1
22 #include <typeinfo>
23 #include <cassert>
24 #include <cxxabi.h>
25 #include <thread>
26 #include <sstream>
27 
28 #include "portexception.hpp"
29 #include "schedule.hpp"
30 #include "simpleschedule.hpp"
31 #include "kernel.hpp"
32 #include "port_info.hpp"
33 #include "allocate.hpp"
34 #include "dynalloc.hpp"
35 #include "stdalloc.hpp"
36 #include "mapbase.hpp"
37 #include "poolschedule.hpp"
38 
39 class Map : public MapBase
40 {
41 public:
46  Map();
50  virtual ~Map();
51 
52 
53  template< class scheduler = pool_schedule, class allocator = dynalloc >
54  void exe()
55  {
57  volatile bool exit_alloc( false );
58  allocator alloc( (*this), exit_alloc );
60  std::thread mem_thread( [&](){
61  alloc.run();
62  });
63 
64  alloc.waitTillReady();
65 
66  scheduler sched( (*this) );
67  sched.init();
69  std::thread sched_thread( [&](){
70  sched.start();
71  });
73  sched_thread.join();
75  exit_alloc = true;
76  mem_thread.join();
78  return;
79  }
80 
81 
82 protected:
83 
90  void checkEdges( std::set< raft::kernel* > &source_k );
91 
99  void printEdges( std::set< raft::kernel* > &source_k );
100 
101 
102 
103  friend class Schedule;
104  friend class Allocate;
105 };
106 
107 #endif /* END _MAP_HPP_ */
void exe()
Definition: map.hpp:54
Definition: mapbase.hpp:98
std::set< raft::kernel * > source_kernels
Definition: mapbase.hpp:374
void printEdges(std::set< raft::kernel * > &source_k)
Definition: map.cpp:66
void checkEdges(std::set< raft::kernel * > &source_k)
Definition: map.cpp:49
virtual ~Map()
Definition: map.cpp:40
Definition: map.hpp:39
Definition: allocate.hpp:36
Map()
Definition: map.cpp:35
Definition: schedule.hpp:31