17 #ifndef _FGT_GRAPH_TRACE_IMPL_H 18 #define _FGT_GRAPH_TRACE_IMPL_H 20 #include "../tbb_profiling.h" 21 #if (_MSC_VER >= 1900) 28 #if TBB_USE_THREADING_TOOLS 29 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 30 #if (_MSC_VER >= 1900) 31 #define CODEPTR() (_ReturnAddress()) 32 #elif __TBB_GCC_VERSION >= 40800 33 #define CODEPTR() ( __builtin_return_address(0)) 35 #define CODEPTR() NULL 38 #define CODEPTR() NULL 48 static inline void fgt_composite (
void* codeptr,
void *node,
void *graph ) {
51 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 52 if (codeptr != NULL) {
58 static inline void fgt_internal_alias_input_port(
void *node,
void *
p,
string_index name_index ) {
63 static inline void fgt_internal_alias_output_port(
void *node,
void *
p,
string_index name_index ) {
68 template<
typename InputType>
71 fgt_internal_alias_input_port( node, port, name_index);
74 template <
typename PortsTuple,
int N >
75 struct fgt_internal_input_alias_helper {
76 static void alias_port(
void *node, PortsTuple &ports ) {
77 alias_input_port( node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_INPUT_PORT_0 + N - 1) );
82 template <
typename PortsTuple >
83 struct fgt_internal_input_alias_helper<PortsTuple, 0> {
84 static void alias_port(
void * , PortsTuple & ) { }
87 template<
typename OutputType>
90 fgt_internal_alias_output_port( node, static_cast<void *>(port), name_index);
93 template <
typename PortsTuple,
int N >
94 struct fgt_internal_output_alias_helper {
95 static void alias_port(
void *node, PortsTuple &ports ) {
96 alias_output_port( node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_OUTPUT_PORT_0 + N - 1) );
101 template <
typename PortsTuple >
102 struct fgt_internal_output_alias_helper<PortsTuple, 0> {
103 static void alias_port(
void * , PortsTuple & ) {
107 static inline void fgt_internal_create_input_port(
void *node,
void *
p,
string_index name_index ) {
111 static inline void fgt_internal_create_output_port(
void* codeptr,
void *node,
void *
p,
string_index name_index ) {
114 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 115 if (codeptr != NULL) {
121 template<
typename InputType>
127 fgt_internal_create_input_port(node, static_cast<void*>(port), name_index);
130 template <
typename PortsTuple,
int N >
131 struct fgt_internal_input_helper {
132 static void register_port(
void *node, PortsTuple &ports ) {
133 register_input_port( node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_INPUT_PORT_0 + N - 1) );
134 fgt_internal_input_helper<PortsTuple, N-1>::register_port( node, ports );
138 template <
typename PortsTuple >
139 struct fgt_internal_input_helper<PortsTuple, 1> {
140 static void register_port(
void *node, PortsTuple &ports ) {
141 register_input_port( node, &(tbb::flow::get<0>(ports)), FLOW_INPUT_PORT_0 );
145 template<
typename OutputType>
148 fgt_internal_create_output_port( codeptr, node, static_cast<void *>(port), name_index);
151 template <
typename PortsTuple,
int N >
152 struct fgt_internal_output_helper {
153 static void register_port(
void* codeptr,
void *node, PortsTuple &ports ) {
154 register_output_port( codeptr, node, &(tbb::flow::get<N-1>(ports)), static_cast<tbb::internal::string_index>(FLOW_OUTPUT_PORT_0 + N - 1) );
155 fgt_internal_output_helper<PortsTuple, N-1>::register_port( codeptr, node, ports );
159 template <
typename PortsTuple >
160 struct fgt_internal_output_helper<PortsTuple,1> {
161 static void register_port(
void* codeptr,
void *node, PortsTuple &ports ) {
162 register_output_port( codeptr, node, &(tbb::flow::get<0>(ports)), FLOW_OUTPUT_PORT_0 );
166 template<
typename NodeType >
172 template<
typename NodeType >
174 void *
addr = const_cast<NodeType *>(node);
178 template<
typename NodeType >
179 static inline void fgt_node_desc(
const NodeType *node,
const char *desc ) {
188 static inline void fgt_body(
void *node,
void *body ) {
192 template<
int N,
typename PortsTuple >
196 fgt_internal_output_helper<PortsTuple, N>::register_port(codeptr,
input_port, ports );
199 template<
int N,
typename PortsTuple >
203 fgt_internal_output_helper<PortsTuple, N>::register_port( codeptr,
input_port, ports );
207 template<
int N,
typename PortsTuple >
211 fgt_internal_input_helper<PortsTuple, N>::register_port(
output_port, ports );
217 #if TBB_PREVIEW_FLOW_GRAPH_TRACE 218 if (codeptr != NULL) {
248 fgt_internal_create_input_port(
output_port, decrement_port, FLOW_INPUT_PORT_1 );
259 static inline void fgt_graph(
void *g ) {
295 #else // TBB_USE_THREADING_TOOLS 297 #define CODEPTR() NULL 305 template<
typename NodeType >
308 template<
typename NodeType >
315 template<
int N,
typename PortsTuple >
318 template<
int N,
typename PortsTuple >
321 template<
int N,
typename PortsTuple >
346 template<
typename NodeType >
349 template <
typename PortsTuple,
int N >
354 template <
typename PortsTuple,
int N >
359 #endif // TBB_USE_THREADING_TOOLS
static void fgt_async_reserve(void *, void *)
static void fgt_graph(void *)
static void fgt_multiinput_node(void *, string_index, void *, PortsTuple &, void *)
static void fgt_make_edge(void *, void *)
Forward declaration section.
static void fgt_remove_edge(void *, void *)
static void fgt_composite(void *, void *, void *)
static void fgt_multioutput_node_with_body(void *, string_index, void *, void *, PortsTuple &, void *)
static void fgt_graph_desc(void *, const char *)
static void fgt_multioutput_node(void *, string_index, void *, void *, PortsTuple &)
void itt_task_begin(itt_domain_enum, void *, unsigned long long, void *, unsigned long long, string_index)
void itt_region_begin(itt_domain_enum, void *, unsigned long long, void *, unsigned long long, string_index)
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(void *, string_index, void *, void *)
tbb::flow::tuple_element< N, typename MOP::output_ports_type >::type & output_port(MOP &op)
void itt_task_end(itt_domain_enum)
void suppress_unused_warning(const T1 &)
Utility template function to prevent "unused" warnings by various compilers.
static void fgt_multiinput_multioutput_node(void *, string_index, void *, void *)
void itt_relation_add(itt_domain_enum, void *, unsigned long long, itt_relation, void *, unsigned long long)
static void fgt_release_wait(void *)
static void fgt_async_try_put_begin(void *, void *)
static void fgt_end_body(void *)
void const char const char int ITT_FORMAT __itt_group_sync p
void itt_make_task_group(itt_domain_enum, void *, unsigned long long, void *, unsigned long long, string_index)
static void fgt_async_commit(void *, void *)
Pure virtual template class that defines a receiver of messages of type T.
static void fgt_body(void *, void *)
static void fgt_reserve_wait(void *)
void fgt_multiinput_multioutput_node_desc(const NodeType *, const char *)
void itt_region_end(itt_domain_enum, void *, unsigned long long)
static void fgt_alias_port(void *, void *, bool)
static void fgt_multioutput_node_desc(const NodeType *, const char *)
static void fgt_async_try_put_end(void *, void *)
static void alias_port(void *, PortsTuple &)
static void fgt_node_desc(const NodeType *, const char *)
void register_node_addr(itt_domain_enum, void *, unsigned long long, string_index, void *)
static void fgt_node_with_body(void *, string_index, void *, void *, void *)
static void fgt_begin_body(void *)
void itt_metadata_str_add(itt_domain_enum, void *, unsigned long long, string_index, const char *)
static void alias_port(void *, PortsTuple &)