make_tt.h File Reference

Classes

class  CallableWrapTT< funcT, returnT, funcT_receives_input_tuple, funcT_receives_outterm_tuple, space, keyT, output_terminalsT, input_valuesT >
 
struct  CallableWrapTTAsTypelist< funcT, returnT, funcT_receives_input_tuple, funcT_receives_outterm_tuple, space, keyT, output_terminalsT, std::tuple< input_valuesT... > >
 
struct  CallableWrapTTAsTypelist< funcT, returnT, funcT_receives_input_tuple, funcT_receives_outterm_tuple, space, keyT, output_terminalsT, ttg::meta::typelist< input_valuesT... > >
 

Functions

template<ttg::ExecutionSpace space, typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt_tpl (funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges=std::tuple<>{}, const std::tuple< output_edgesT... > &outedges=std::tuple<>{}, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
 Factory function to assist in wrapping a callable with signature. More...
 
template<typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt_tpl (funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges=std::tuple<>{}, const std::tuple< output_edgesT... > &outedges=std::tuple<>{}, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
 
template<ttg::ExecutionSpace space, typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt (funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges=std::tuple<>{}, const std::tuple< output_edgesT... > &outedges=std::tuple<>{}, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
 Factory function to assist in wrapping a callable with signature. More...
 
template<typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt (funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges=std::tuple<>{}, const std::tuple< output_edgesT... > &outedges=std::tuple<>{}, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
 
template<typename keyT , typename funcT , typename... input_valuesT, typename... output_edgesT>
auto wrapt (funcT &&func, const std::tuple< ttg::Edge< keyT, input_valuesT >... > &inedges, const std::tuple< output_edgesT... > &outedges, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
 
template<typename keyT , typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto wrap (funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges, const std::tuple< output_edgesT... > &outedges, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
 

Function Documentation

◆ make_tt() [1/2]

template<ttg::ExecutionSpace space, typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt ( funcT &&  func,
const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &  inedges = std::tuple<>{},
const std::tuple< output_edgesT... > &  outedges = std::tuple<>{},
const std::string &  name = "wrapper",
const std::vector< std::string > &  innames = std::vector<std::string>(sizeof...(input_edge_valuesT), "input"),
const std::vector< std::string > &  outnames = std::vector<std::string>(sizeof...(output_edgesT), "output") 
)

Factory function to assist in wrapping a callable with signature.

Template Parameters
keyTa task ID type
funcTa callable type
input_edge_valuesTa pack of types of input data
output_edgesTa pack of types of output edges
Parameters
[in]funca callable object; it can be generic (e.g., a template function, a generic lambda, etc.; see below) or nongeneric (with concrete types for its arguments). In either case its signature must match the following:
  • if ttg::meta::is_void_v<keyT>==true:
    • void(input_valuesT&&..., std::tuple<output_terminalsT...>&): full form, with the explicitly-passed output terminals ensuring compile-time type-checking of the dataflow into the output terminals (see ttg::send);
    • void(input_valuesT&&...): simplified form, with no type-checking of the dataflow into the output terminals;
  • if ttg::meta::is_void_v<keyT>==false:
    • void(const keyT&, input_valuesT&&..., std::tuple<output_terminalsT...>&): full form, with the explicitly-passed output terminals ensuring compile-time type-checking of the dataflow into the output terminals (see ttg::send);
    • void(const keyT&, input_valuesT&&...): simplified form, with no type-checking of the dataflow into the output terminals.
[in]inedgesa tuple of input edges
[in]outedgesa tuple of output edges
[in]namea string label for the resulting TT
[in]namea string label for the resulting TT
[in]innamesstring labels for the respective input terminals of the resulting TT
[in]outnamesstring labels for the respective output terminals of the resulting TT
Warning
You MUST NOT use generic callables that use concrete types for some data arguments, i.e. make either ALL data types or NONE of them generic. This warning only applies to the data arguments and does not apply to task ID (key) and optional out-terminal arguments.
Note
For generic callables the arguments that are used read-only should be declared as U& (where U is the corresponding template parameter) or auto& (in contexts such as generic lambdas where template arguments are implicit). The arguments that are to be consumed (e.g. mutated, moved, etc.) should be declared as U&& or auto&& (i.e., as universal references). For example, in
make_tt([](auto& key, auto& datum1, auto&& datum2) { ... }, ...);
auto make_tt(funcT &&func, const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &inedges=std::tuple<>{}, const std::tuple< output_edgesT... > &outedges=std::tuple<>{}, const std::string &name="wrapper", const std::vector< std::string > &innames=std::vector< std::string >(sizeof...(input_edge_valuesT), "input"), const std::vector< std::string > &outnames=std::vector< std::string >(sizeof...(output_edgesT), "output"))
Factory function to assist in wrapping a callable with signature.
Definition: make_tt.h:496
the task id (key) and the first datum will be passed by const lvalue reference (i.e. no copy will be created by the runtime), whereas the second datum will be passed by an rvalue reference, which may cause copying. The corresponding free function analog of the above lambda is:
template <typename K, typename D1, typename D2>
void func (K& key, D1& datum1, D2&& datum2) { ... }
Warning
Although generic arguments annotated by const auto& are also permitted, their use is discouraged to avoid confusion; namely, const auto& denotes a consumable argument, NOT read-only, despite the const.
Examples
distributed.cc, iterative.cc, reducing.cc, and simple.cc.

Definition at line 496 of file make_tt.h.

◆ make_tt() [2/2]

template<typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt ( funcT &&  func,
const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &  inedges = std::tuple<>{},
const std::tuple< output_edgesT... > &  outedges = std::tuple<>{},
const std::string &  name = "wrapper",
const std::vector< std::string > &  innames = std::vector<std::string>(sizeof...(input_edge_valuesT), "input"),
const std::vector< std::string > &  outnames = std::vector<std::string>(sizeof...(output_edgesT), "output") 
)

Definition at line 578 of file make_tt.h.

◆ make_tt_tpl() [1/2]

template<ttg::ExecutionSpace space, typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt_tpl ( funcT &&  func,
const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &  inedges = std::tuple<>{},
const std::tuple< output_edgesT... > &  outedges = std::tuple<>{},
const std::string &  name = "wrapper",
const std::vector< std::string > &  innames = std::vector<std::string>(sizeof...(input_edge_valuesT),                                                                                    "input"),
const std::vector< std::string > &  outnames = std::vector<std::string>(sizeof...(output_edgesT),                                                                                     "output") 
)

Factory function to assist in wrapping a callable with signature.

Template Parameters
keyTa task ID type
funcTa callable type
input_edge_valuesTa pack of types of input data
output_edgesTa pack of types of output edges
Parameters
[in]funca callable object; it can be generic (e.g., a template function, a generic lambda, etc.; see below) or nongeneric (with concrete types for its arguments). In either case its signature must match the following:
  • if ttg::meta::is_void_v<keyT>==true:
    • void(const std::tuple<input_valuesT&...>&, std::tuple<output_terminalsT...>&): full form, with the explicitly-passed output terminals ensuring compile-time type-checking of the dataflow into the output terminals (see ttg::send);
    • void(const std::tuple<input_valuesT&...>&): simplified form, with no type-checking of the dataflow into the output terminals;
  • if ttg::meta::is_void_v<keyT>==false:
    • void(const keyT&, const std::tuple<input_valuesT&...>&, std::tuple<output_terminalsT...>&): full form, with the explicitly-passed output terminals ensuring compile-time type-checking of the dataflow into the output terminals (see ttg::send);
    • void(const keyT&, const std::tuple<input_valuesT&...>&): simplified form, with no type-checking of the dataflow into the output terminals.
[in]inedgesa tuple of input edges
[in]outedgesa tuple of output edges
[in]namea string label for the resulting TT
[in]namea string label for the resulting TT
[in]innamesstring labels for the respective input terminals of the resulting TT
[in]outnamesstring labels for the respective output terminals of the resulting TT
Note
Handling of generic func is described in the documentation of make_tt()

Definition at line 348 of file make_tt.h.

◆ make_tt_tpl() [2/2]

template<typename keyT = void, typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto make_tt_tpl ( funcT &&  func,
const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &  inedges = std::tuple<>{},
const std::tuple< output_edgesT... > &  outedges = std::tuple<>{},
const std::string &  name = "wrapper",
const std::vector< std::string > &  innames = std::vector<std::string>(sizeof...(input_edge_valuesT),                                                                                    "input"),
const std::vector< std::string > &  outnames = std::vector<std::string>(sizeof...(output_edgesT),                                                                                     "output") 
)

Definition at line 436 of file make_tt.h.

◆ wrap()

template<typename keyT , typename funcT , typename... input_edge_valuesT, typename... output_edgesT>
auto wrap ( funcT &&  func,
const std::tuple< ttg::Edge< keyT, input_edge_valuesT >... > &  inedges,
const std::tuple< output_edgesT... > &  outedges,
const std::string &  name = "wrapper",
const std::vector< std::string > &  innames = std::vector<std::string>(sizeof...(input_edge_valuesT), "input"),
const std::vector< std::string > &  outnames = std::vector<std::string>(sizeof...(output_edgesT), "output") 
)

Definition at line 595 of file make_tt.h.

◆ wrapt()

template<typename keyT , typename funcT , typename... input_valuesT, typename... output_edgesT>
auto wrapt ( funcT &&  func,
const std::tuple< ttg::Edge< keyT, input_valuesT >... > &  inedges,
const std::tuple< output_edgesT... > &  outedges,
const std::string &  name = "wrapper",
const std::vector< std::string > &  innames = std::vector<std::string>(sizeof...(input_valuesT), "input"),
const std::vector< std::string > &  outnames = std::vector<std::string>(sizeof...(output_edgesT), "output") 
)
inline

Definition at line 586 of file make_tt.h.