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
-
keyT a task ID type funcT a callable type input_edge_valuesT a pack of types of input data output_edgesT a pack of types of output edges
- Parameters
-
[in] func a 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] inedges a tuple of input edges [in] outedges a tuple of output edges [in] name a string label for the resulting TT [in] name a string label for the resulting TT [in] innames string labels for the respective input terminals of the resulting TT [in] outnames string labels for the respective output terminals of the resulting TT - if
- 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&
(whereU
is the corresponding template parameter) orauto&
(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 asU&&
orauto&&
(i.e., as universal references). For example, inauto 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:496key
) 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 theconst
.
- Examples
- distributed.cc, iterative.cc, reducing.cc, and simple.cc.
◆ 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") |
||
) |
◆ 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
-
keyT a task ID type funcT a callable type input_edge_valuesT a pack of types of input data output_edgesT a pack of types of output edges
- Parameters
-
[in] func a 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] inedges a tuple of input edges [in] outedges a tuple of output edges [in] name a string label for the resulting TT [in] name a string label for the resulting TT [in] innames string labels for the respective input terminals of the resulting TT [in] outnames string labels for the respective output terminals of the resulting TT - if
- Note
- Handling of generic
func
is described in the documentation of make_tt()
◆ 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") |
||
) |
◆ 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") |
||
) |
◆ wrapt()
template<typename keyT , typename funcT , typename... input_valuesT, typename... output_edgesT>
|
inline |