ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
fwd.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2#ifndef TTG_PARSEC_FWD_H
3#define TTG_PARSEC_FWD_H
4
5#include "ttg/fwd.h"
6#include "ttg/util/typelist.h"
7#include "ttg/util/span.h"
8
9#include <future>
10
11#include <parsec.h>
12
13extern "C" struct parsec_context_s;
14
15namespace ttg_parsec {
16
17 template <typename keyT, typename output_terminalsT, typename derivedT,
18 typename input_valueTs = ttg::typelist<>,
20 class TT;
21
23 template <typename keyT, typename output_terminalsT, typename derivedT, typename... input_valueTs>
24 using Op [[deprecated("use TT instead")]] = TT<keyT, output_terminalsT, derivedT, ttg::typelist<input_valueTs...>>;
26 template <typename keyT, typename output_terminalsT, typename derivedT, typename... input_valueTs>
27 using TemplateTask = TT<keyT, output_terminalsT, derivedT, ttg::typelist<input_valueTs...>>;
28
29 class WorldImpl;
30
31 inline void make_executable_hook(ttg::World&);
32
33 inline void ttg_initialize(int argc, char **argv, int num_threads = -1, parsec_context_s * = nullptr);
34
35 inline void ttg_finalize();
36
37 [[noreturn]]
38 static inline void ttg_abort();
39
41
42 inline void ttg_execute(ttg::World world);
43
44 inline void ttg_fence(ttg::World world);
45
46 template <typename T>
47 inline void ttg_register_ptr(ttg::World world, const std::shared_ptr<T> &ptr);
48
49 inline void ttg_register_status(ttg::World world, const std::shared_ptr<std::promise<void>> &status_ptr);
50
51 template <typename Callback>
52 inline void ttg_register_callback(ttg::World world, Callback &&callback);
53
54 inline ttg::Edge<> &ttg_ctl_edge(ttg::World world);
55
56 inline void ttg_sum(ttg::World world, double &value);
57
60 template <typename T>
61 static void ttg_broadcast(ttg::World world, T &data, int source_rank);
62
63 /* device definitions */
64 template<typename T, typename Allocator = std::allocator<std::decay_t<T>>>
65 struct Buffer;
66
67 template<typename T>
68 struct Ptr;
69
70 template<typename T>
71 struct devicescratch;
72
73 template<typename T>
74 struct TTValue;
75
76 template<typename T, typename... Args>
77 inline Ptr<T> make_ptr(Args&&... args);
78
79 template<typename T>
80 inline Ptr<std::decay_t<T>> get_ptr(T&& obj);
81
82 template<typename... Views>
83 bool register_device_memory(std::tuple<Views&...> &views);
84
85 template<typename T, std::size_t N>
86 bool register_device_memory(const ttg::span<T, N>& span);
87
88 template<typename... Buffer>
89 void post_device_out(std::tuple<Buffer&...> &b);
90
91 template<typename... Buffer>
92 void mark_device_out(std::tuple<Buffer&...> &b);
93
94 inline int num_devices();
95
96 template<typename T>
97 parsec_data_t* buffer_data(T&& buffer);
98
99} // namespace ttg_parsec
100
101#endif // TTG_PARSEC_FWD_H
Edge is used to connect In and Out terminals.
Definition edge.h:26
this contains PaRSEC-based TTG functionality
Definition fwd.h:19
void ttg_fence(ttg::World world)
Definition ttg.h:1141
void ttg_finalize()
Definition ttg.h:1127
void ttg_register_ptr(ttg::World world, const std::shared_ptr< T > &ptr)
Definition ttg.h:1144
Ptr< std::decay_t< T > > get_ptr(T &&obj)
Definition ptr.h:253
int num_devices()
Definition device.h:42
Ptr< T > make_ptr(Args &&... args)
Definition ptr.h:271
void ttg_register_callback(ttg::World world, Callback &&callback)
Definition ttg.h:1158
ttg::Edge & ttg_ctl_edge(ttg::World world)
Definition ttg.h:1162
void make_executable_hook(ttg::World &)
Definition ttg.h:1170
void post_device_out(std::tuple< Buffer &... > &b)
Definition devicefunc.h:274
void ttg_initialize(int argc, char **argv, int num_threads=-1, parsec_context_s *=nullptr)
parsec_data_t * buffer_data(T &&buffer)
Definition devicefunc.h:279
ttg::World ttg_default_execution_context()
Definition ttg.h:1137
void ttg_execute(ttg::World world)
Definition ttg.h:1140
bool register_device_memory(std::tuple< Views &... > &views)
Definition devicefunc.h:80
void mark_device_out(std::tuple< Buffer &... > &b)
Definition devicefunc.h:237
void ttg_sum(ttg::World world, double &value)
Definition ttg.h:1164
void ttg_register_status(ttg::World world, const std::shared_ptr< std::promise< void > > &status_ptr)
Definition ttg.h:1153
ExecutionSpace
denotes task execution space
Definition execution.h:18
A container for types.
Definition typelist.h:25