fwd.h
Go to the documentation of this file.
1 #ifndef TTG_PARSEC_FWD_H
2 #define TTG_PARSEC_FWD_H
3 
4 #include "ttg/fwd.h"
5 #include "ttg/util/typelist.h"
6 
7 #include <future>
8 
9 extern "C" struct parsec_context_s;
10 
11 namespace ttg_parsec {
12 
13  template <typename keyT, typename output_terminalsT, typename derivedT, typename input_valueTs = ttg::typelist<>>
14  class TT;
15 
17  template <typename keyT, typename output_terminalsT, typename derivedT, typename... input_valueTs>
18  using Op [[deprecated("use TT instead")]] = TT<keyT, output_terminalsT, derivedT, ttg::typelist<input_valueTs...>>;
20  template <typename keyT, typename output_terminalsT, typename derivedT, typename... input_valueTs>
21  using TemplateTask = TT<keyT, output_terminalsT, derivedT, ttg::typelist<input_valueTs...>>;
22 
23  class WorldImpl;
24 
25  inline void make_executable_hook(ttg::World&);
26 
27  inline void ttg_initialize(int argc, char **argv, int num_threads = -1, parsec_context_s * = nullptr);
28 
29  inline void ttg_finalize();
30 
31  [[noreturn]]
32  static inline void ttg_abort();
33 
35 
36  inline void ttg_execute(ttg::World world);
37 
38  inline void ttg_fence(ttg::World world);
39 
40  template <typename T>
41  inline void ttg_register_ptr(ttg::World world, const std::shared_ptr<T> &ptr);
42 
43  inline void ttg_register_status(ttg::World world, const std::shared_ptr<std::promise<void>> &status_ptr);
44 
45  template <typename Callback>
46  inline void ttg_register_callback(ttg::World world, Callback &&callback);
47 
48  inline ttg::Edge<> &ttg_ctl_edge(ttg::World world);
49 
50  inline void ttg_sum(ttg::World world, double &value);
51 
54  template <typename T>
55  static void ttg_broadcast(ttg::World world, T &data, int source_rank);
56 
57  /* device definitions */
58  template<typename T, typename Allocator = std::allocator<T>>
59  struct Buffer;
60 
61  template<typename T>
62  struct Ptr;
63 
64  template<typename T>
65  struct devicescratch;
66 
67  template<typename T>
68  struct TTValue;
69 
70  template<typename T, typename... Args>
71  inline Ptr<T> make_ptr(Args&&... args);
72 
73  template<typename T>
74  inline Ptr<std::decay_t<T>> get_ptr(T&& obj);
75 
76  template<typename... Views>
77  inline bool register_device_memory(std::tuple<Views&...> &views);
78 
79  template<typename... Buffer>
80  inline void post_device_out(std::tuple<Buffer&...> &b);
81 
82  template<typename... Buffer>
83  inline void mark_device_out(std::tuple<Buffer&...> &b);
84 
85  inline int num_devices();
86 
87 #if 0
88  template<typename... Args>
89  inline std::pair<bool, std::tuple<ptr<std::decay_t<Args>>...>> get_ptr(Args&&... args);
90 #endif
91 
92 } // namespace ttg_parsec
93 
94 #endif // TTG_PARSEC_FWD_H
Edge is used to connect In and Out terminals.
Definition: edge.h:25
constexpr auto data(C &c) -> decltype(c.data())
Definition: span.h:189
int num_threads()
Determine the number of compute threads to use by TTG when not given to ttg::initialize
Definition: env.cpp:15
this contains PaRSEC-based TTG functionality
Definition: fwd.h:18
void ttg_fence(ttg::World world)
Definition: ttg.h:1093
void ttg_finalize()
Definition: ttg.h:1079
void ttg_register_ptr(ttg::World world, const std::shared_ptr< T > &ptr)
Definition: ttg.h:1096
Ptr< std::decay_t< T > > get_ptr(T &&obj)
Definition: ptr.h:252
int num_devices()
Definition: device.h:41
Ptr< T > make_ptr(Args &&... args)
Definition: ptr.h:270
void ttg_register_callback(ttg::World world, Callback &&callback)
Definition: ttg.h:1110
ttg::Edge & ttg_ctl_edge(ttg::World world)
Definition: ttg.h:1114
void make_executable_hook(ttg::World &)
Definition: ttg.h:1122
void post_device_out(std::tuple< Buffer &... > &b)
Definition: devicefunc.h:171
void ttg_initialize(int argc, char **argv, int num_threads=-1, parsec_context_s *=nullptr)
void ttg_register_status(ttg::World world, const std::shared_ptr< std::promise< void >> &status_ptr)
Definition: ttg.h:1105
ttg::World ttg_default_execution_context()
Definition: ttg.h:1089
void ttg_execute(ttg::World world)
Definition: ttg.h:1092
bool register_device_memory(std::tuple< Views &... > &views)
Definition: devicefunc.h:82
void mark_device_out(std::tuple< Buffer &... > &b)
Definition: devicefunc.h:135
void ttg_sum(ttg::World world, double &value)
Definition: ttg.h:1116
A container for types.
Definition: typelist.h:24