17 #ifndef _FGT_GRAPH_TRACE_IMPL_H 18 #define _FGT_GRAPH_TRACE_IMPL_H 20 #include "../tbb_profiling.h" 25 #if TBB_USE_THREADING_TOOLS 34 static inline void fgt_composite (
void *node,
void *graph ) {
38 static inline void fgt_internal_alias_input_port(
void *node,
void *p,
string_index name_index ) {
43 static inline void fgt_internal_alias_output_port(
void *node,
void *p,
string_index name_index ) {
48 template<
typename InputType>
51 fgt_internal_alias_input_port( node, port, name_index);
54 template <
typename PortsTuple,
int N >
55 struct fgt_internal_input_alias_helper {
56 static void alias_port(
void *node, PortsTuple &ports ) {
57 alias_input_port( node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_INPUT_PORT_0 + N - 1) );
62 template <
typename PortsTuple >
63 struct fgt_internal_input_alias_helper<PortsTuple, 0> {
64 static void alias_port(
void * , PortsTuple & ) { }
67 template<
typename OutputType>
70 fgt_internal_alias_output_port( node, static_cast<void *>(port), name_index);
73 template <
typename PortsTuple,
int N >
74 struct fgt_internal_output_alias_helper {
75 static void alias_port(
void *node, PortsTuple &ports ) {
76 alias_output_port( node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_OUTPUT_PORT_0 + N - 1) );
81 template <
typename PortsTuple >
82 struct fgt_internal_output_alias_helper<PortsTuple, 0> {
83 static void alias_port(
void * , PortsTuple & ) {
87 static inline void fgt_internal_create_input_port(
void *node,
void *p,
string_index name_index ) {
91 static inline void fgt_internal_create_output_port(
void *node,
void *p,
string_index name_index ) {
95 template<
typename InputType>
101 fgt_internal_create_input_port(node, static_cast<void*>(port), name_index);
104 template <
typename PortsTuple,
int N >
105 struct fgt_internal_input_helper {
106 static void register_port(
void *node, PortsTuple &ports ) {
107 register_input_port( node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_INPUT_PORT_0 + N - 1) );
108 fgt_internal_input_helper<PortsTuple, N-1>::register_port( node, ports );
112 template <
typename PortsTuple >
113 struct fgt_internal_input_helper<PortsTuple, 1> {
114 static void register_port(
void *node, PortsTuple &ports ) {
115 register_input_port( node, &(tbb::flow::get<0>(ports)), FLOW_INPUT_PORT_0 );
119 template<
typename OutputType>
122 fgt_internal_create_output_port( node, static_cast<void *>(port), name_index);
125 template <
typename PortsTuple,
int N >
126 struct fgt_internal_output_helper {
127 static void register_port(
void *node, PortsTuple &ports ) {
128 register_output_port( node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_OUTPUT_PORT_0 + N - 1) );
129 fgt_internal_output_helper<PortsTuple, N-1>::register_port( node, ports );
133 template <
typename PortsTuple >
134 struct fgt_internal_output_helper<PortsTuple,1> {
135 static void register_port(
void *node, PortsTuple &ports ) {
136 register_output_port( node, &(tbb::flow::get<0>(ports)), FLOW_OUTPUT_PORT_0 );
140 template<
typename NodeType >
146 template<
typename NodeType >
148 void *addr =
const_cast<NodeType *
>(node);
152 template<
typename NodeType >
153 static inline void fgt_node_desc(
const NodeType *node,
const char *desc ) {
162 static inline void fgt_body(
void *node,
void *body ) {
166 template<
int N,
typename PortsTuple >
169 fgt_internal_create_input_port( input_port, input_port, FLOW_INPUT_PORT_0 );
170 fgt_internal_output_helper<PortsTuple, N>::register_port( input_port, ports );
173 template<
int N,
typename PortsTuple >
176 fgt_internal_create_input_port( input_port, input_port, FLOW_INPUT_PORT_0 );
177 fgt_internal_output_helper<PortsTuple, N>::register_port( input_port, ports );
181 template<
int N,
typename PortsTuple >
184 fgt_internal_create_output_port( output_port, output_port, FLOW_OUTPUT_PORT_0 );
185 fgt_internal_input_helper<PortsTuple, N>::register_port( output_port, ports );
194 fgt_internal_create_output_port( output_port, output_port, FLOW_OUTPUT_PORT_0 );
199 fgt_internal_create_output_port( output_port, output_port, FLOW_OUTPUT_PORT_0 );
206 fgt_internal_create_input_port( output_port, input_port, FLOW_INPUT_PORT_0 );
211 fgt_internal_create_input_port( output_port, input_port, FLOW_INPUT_PORT_0 );
216 fgt_node( t, g, input_port, output_port );
217 fgt_internal_create_input_port( output_port, decrement_port, FLOW_INPUT_PORT_1 );
228 static inline void fgt_graph(
void *g ) {
264 #else // TBB_USE_THREADING_TOOLS 272 template<
typename NodeType >
275 template<
typename NodeType >
282 template<
int N,
typename PortsTuple >
285 template<
int N,
typename PortsTuple >
288 template<
int N,
typename PortsTuple >
313 template<
typename NodeType >
316 template <
typename PortsTuple,
int N >
321 template <
typename PortsTuple,
int N >
326 #endif // TBB_USE_THREADING_TOOLS static void fgt_body(void *, void *)
void itt_task_begin(itt_domain_enum, void *, unsigned long long, void *, unsigned long long, string_index)
Pure virtual template class that defines a receiver of messages of type T.
static void fgt_end_body(void *)
static void alias_port(void *, PortsTuple &)
static void fgt_node_with_body(string_index, void *, void *, void *)
void itt_metadata_str_add(itt_domain_enum, void *, unsigned long long, string_index, const char *)
void itt_relation_add(itt_domain_enum, void *, unsigned long long, itt_relation, void *, unsigned long long)
static void fgt_make_edge(void *, void *)
static void fgt_graph_desc(void *, const char *)
static void fgt_multioutput_node(string_index, void *, void *, PortsTuple &)
void itt_task_end(itt_domain_enum)
static void fgt_async_commit(void *, void *)
static void fgt_multioutput_node_desc(const NodeType *, const char *)
static void fgt_async_try_put_end(void *, void *)
static void fgt_reserve_wait(void *)
void fgt_multiinput_multioutput_node_desc(const NodeType *, const char *)
static void fgt_node(string_index, void *, void *)
void itt_region_end(itt_domain_enum, void *, unsigned long long)
static void fgt_async_reserve(void *, void *)
static void fgt_multioutput_node_with_body(string_index, void *, void *, PortsTuple &, void *)
static void alias_port(void *, PortsTuple &)
static void fgt_begin_body(void *)
static void fgt_composite(void *, void *)
static void fgt_release_wait(void *)
static void fgt_graph(void *)
tbb::flow::tuple_element< N, typename JNT::input_ports_type >::type & input_port(JNT &jn)
templated function to refer to input ports of the join node
static void fgt_node_desc(const NodeType *, const char *)
static void fgt_multiinput_multioutput_node(string_index, void *, void *)
static void fgt_alias_port(void *, void *, bool)
void itt_make_task_group(itt_domain_enum, void *, unsigned long long, void *, unsigned long long, string_index)
Forward declaration section.
void const char const char int ITT_FORMAT __itt_group_sync p
void itt_region_begin(itt_domain_enum, void *, unsigned long long, void *, unsigned long long, string_index)
tbb::flow::tuple_element< N, typename MOP::output_ports_type >::type & output_port(MOP &op)
static void fgt_async_try_put_begin(void *, void *)
static void fgt_multiinput_node(string_index, void *, PortsTuple &, void *)
static void fgt_remove_edge(void *, void *)