fwd.h
Go to the documentation of this file.
1 #ifndef TTG_MADNESS_FWD_H
2 #define TTG_MADNESS_FWD_H
3 
4 #include "ttg/fwd.h"
5 #include "ttg/util/typelist.h"
6 
7 #include <future>
8 
9 namespace ttg_madness {
10 
11  template <typename keyT, typename output_terminalsT, typename derivedT, typename input_valueTs = ttg::typelist<>>
12  class TT;
13 
15  template <typename keyT, typename output_terminalsT, typename derivedT, typename... input_valueTs>
16  using Op [[deprecated("use TT instead")]] = TT<keyT, output_terminalsT, derivedT, ttg::typelist<input_valueTs...>>;
18  template <typename keyT, typename output_terminalsT, typename derivedT, typename... input_valueTs>
19  using TemplateTask = TT<keyT, output_terminalsT, derivedT, ttg::typelist<input_valueTs...>>;
20 
21  class WorldImpl;
22 
23  inline void make_executable_hook(ttg::World&);
24 
25  inline void ttg_initialize(int argc, char **argv, int num_threads = -1);
26 
27  inline void ttg_finalize();
28 
29  [[noreturn]]
30  inline void ttg_abort();
31 
33 
34  inline void ttg_execute(ttg::World world);
35 
36  inline void ttg_fence(ttg::World world);
37 
38  template <typename T>
39  inline void ttg_register_ptr(ttg::World world, const std::shared_ptr<T> &ptr);
40 
41  inline void ttg_register_status(ttg::World world, const std::shared_ptr<std::promise<void>> &status_ptr);
42 
43  inline ttg::Edge<> &ttg_ctl_edge(ttg::World world);
44 
45  template <typename T>
46  inline void ttg_sum(ttg::World world, T &value);
47 
48  template <typename T>
49  inline void ttg_broadcast(ttg::World world, T &data, int source_rank);
50 
51 
52  /* device definitions, not currently provided by this impl */
53  template<typename T, typename Allocator = std::allocator<T>>
54  struct Buffer;
55 
56  template<typename T>
57  struct Ptr;
58 
59  template<typename T>
60  struct devicescratch;
61 
62  template<typename T>
63  struct TTValue;
64 
65  template<typename T, typename... Args>
66  Ptr<T> make_ptr(Args&&... args);
67 
68  template<typename T>
69  auto get_ptr(T&& obj);
70 
71  template<typename... Views>
72  inline bool register_device_memory(std::tuple<Views&...> &views);
73 
74  template<typename... Buffer>
75  inline void post_device_out(std::tuple<Buffer&...> &b);
76 
77  template<typename... Buffer>
78  inline void mark_device_out(std::tuple<Buffer&...> &b);
79 
80  inline int num_devices();
81 
82 } // namespace ttg_madness
83 
84 #endif // TTG_MADNESS_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 MADNESS-based TTG functionality
Definition: fwd.h:16
void ttg_register_ptr(ttg::World world, const std::shared_ptr< T > &ptr)
Definition: ttg.h:147
Ptr< T > make_ptr(Args &&... args)
void ttg_initialize(int argc, char **argv, int num_threads=-1)
Definition: ttg.h:123
int num_devices()
Definition: device.h:6
void ttg_execute(ttg::World world)
Definition: ttg.h:141
ttg::Edge & ttg_ctl_edge(ttg::World world)
Definition: ttg.h:165
auto get_ptr(T &&obj)
void ttg_sum(ttg::World world, T &value)
Definition: ttg.h:168
void ttg_fence(ttg::World world)
Definition: ttg.h:144
void ttg_finalize()
Definition: ttg.h:131
void make_executable_hook(ttg::World &)
Definition: ttg.h:121
void mark_device_out(std::tuple< Buffer &... > &b)
void ttg_broadcast(ttg::World world, T &data, int source_rank)
Definition: ttg.h:174
bool register_device_memory(std::tuple< Views &... > &views)
void ttg_abort()
Definition: ttg.h:137
void post_device_out(std::tuple< Buffer &... > &b)
void ttg_register_status(ttg::World world, const std::shared_ptr< std::promise< void >> &status_ptr)
Definition: ttg.h:156
ttg::World ttg_default_execution_context()
Definition: ttg.h:136
A container for types.
Definition: typelist.h:24
A runtime-managed buffer mirrored between host and device memory.
Definition: buffer.h:10