1 
2 //===----------------------------------------------------------------------===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.txt for details.
8 //
9 //===----------------------------------------------------------------------===//
10 
11 #ifndef _ITTNOTIFY_H_
12 #define _ITTNOTIFY_H_
13 
14 /**
15 @file
16 @brief Public User API functions and types
17 @mainpage
18 
19 The ITT API is used to annotate a user's program with additional information
20 that can be used by correctness and performance tools. The user inserts
21 calls in their program. Those calls generate information that is collected
22 at runtime, and used by Intel(R) Threading Tools.
23 
24 @section API Concepts
25 The following general concepts are used throughout the API.
26 
27 @subsection Unicode Support
28 Many API functions take character string arguments. On Windows, there
29 are two versions of each such function. The function name is suffixed
30 by W if Unicode support is enabled, and by A otherwise. Any API function
31 that takes a character string argument adheres to this convention.
32 
33 @subsection Conditional Compilation
34 Many users prefer having an option to modify ITT API code when linking it
35 inside their runtimes. ITT API header file provides a mechanism to replace
36 ITT API function names inside your code with empty strings. To do this,
37 define the macros INTEL_NO_ITTNOTIFY_API during compilation and remove the
38 static library from the linker script.
39 
40 @subsection Domains
41 [see domains]
42 Domains provide a way to separate notification for different modules or
43 libraries in a program. Domains are specified by dotted character strings,
44 e.g. TBB.Internal.Control.
45 
46 A mechanism (to be specified) is provided to enable and disable
47 domains. By default, all domains are enabled.
48 @subsection Named Entities and Instances
49 Named entities (frames, regions, tasks, and markers) communicate
50 information about the program to the analysis tools. A named entity often
51 refers to a section of program code, or to some set of logical concepts
52 that the programmer wants to group together.
53 
54 Named entities relate to the programmer's static view of the program. When
55 the program actually executes, many instances of a given named entity
56 may be created.
57 
58 The API annotations denote instances of named entities. The actual
59 named entities are displayed using the analysis tools. In other words,
60 the named entities come into existence when instances are created.
61 
62 Instances of named entities may have instance identifiers (IDs). Some
63 API calls use instance identifiers to create relationships between
64 different instances of named entities. Other API calls associate data
65 with instances of named entities.
66 
67 Some named entities must always have instance IDs. In particular, regions
68 and frames always have IDs. Task and markers need IDs only if the ID is
69 needed in another API call (such as adding a relation or metadata).
70 
71 The lifetime of instance IDs is distinct from the lifetime of
72 instances. This allows various relationships to be specified separate
73 from the actual execution of instances. This flexibility comes at the
74 expense of extra API calls.
75 
76 The same ID may not be reused for different instances, unless a previous
77 [ref] __itt_id_destroy call for that ID has been issued.
78 */
79 
80 /** @cond exclude_from_documentation */
81 #ifndef ITT_OS_WIN
82 #  define ITT_OS_WIN   1
83 #endif /* ITT_OS_WIN */
84 
85 #ifndef ITT_OS_LINUX
86 #  define ITT_OS_LINUX 2
87 #endif /* ITT_OS_LINUX */
88 
89 #ifndef ITT_OS_MAC
90 #  define ITT_OS_MAC   3
91 #endif /* ITT_OS_MAC */
92 
93 #ifndef ITT_OS_FREEBSD
94 #  define ITT_OS_FREEBSD   4
95 #endif /* ITT_OS_FREEBSD */
96 
97 #ifndef ITT_OS
98 #  if defined WIN32 || defined _WIN32
99 #    define ITT_OS ITT_OS_WIN
100 #  elif defined( __APPLE__ ) && defined( __MACH__ )
101 #    define ITT_OS ITT_OS_MAC
102 #  elif defined( __FreeBSD__ )
103 #    define ITT_OS ITT_OS_FREEBSD
104 #  else
105 #    define ITT_OS ITT_OS_LINUX
106 #  endif
107 #endif /* ITT_OS */
108 
109 #ifndef ITT_PLATFORM_WIN
110 #  define ITT_PLATFORM_WIN 1
111 #endif /* ITT_PLATFORM_WIN */
112 
113 #ifndef ITT_PLATFORM_POSIX
114 #  define ITT_PLATFORM_POSIX 2
115 #endif /* ITT_PLATFORM_POSIX */
116 
117 #ifndef ITT_PLATFORM_MAC
118 #  define ITT_PLATFORM_MAC 3
119 #endif /* ITT_PLATFORM_MAC */
120 
121 #ifndef ITT_PLATFORM_FREEBSD
122 #  define ITT_PLATFORM_FREEBSD 4
123 #endif /* ITT_PLATFORM_FREEBSD */
124 
125 #ifndef ITT_PLATFORM
126 #  if ITT_OS==ITT_OS_WIN
127 #    define ITT_PLATFORM ITT_PLATFORM_WIN
128 #  elif ITT_OS==ITT_OS_MAC
129 #    define ITT_PLATFORM ITT_PLATFORM_MAC
130 #  elif ITT_OS==ITT_OS_FREEBSD
131 #    define ITT_PLATFORM ITT_PLATFORM_FREEBSD
132 #  else
133 #    define ITT_PLATFORM ITT_PLATFORM_POSIX
134 #  endif
135 #endif /* ITT_PLATFORM */
136 
137 #if defined(_UNICODE) && !defined(UNICODE)
138 #define UNICODE
139 #endif
140 
141 #include <stddef.h>
142 #if ITT_PLATFORM==ITT_PLATFORM_WIN
143 #include <tchar.h>
144 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
145 #include <stdint.h>
146 #if defined(UNICODE) || defined(_UNICODE)
147 #include <wchar.h>
148 #endif /* UNICODE || _UNICODE */
149 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
150 
151 #ifndef ITTAPI_CDECL
152 #  if ITT_PLATFORM==ITT_PLATFORM_WIN
153 #    define ITTAPI_CDECL __cdecl
154 #  else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
155 #    if defined _M_IX86 || defined __i386__
156 #      define ITTAPI_CDECL __attribute__ ((cdecl))
157 #    else  /* _M_IX86 || __i386__ */
158 #      define ITTAPI_CDECL /* actual only on x86 platform */
159 #    endif /* _M_IX86 || __i386__ */
160 #  endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
161 #endif /* ITTAPI_CDECL */
162 
163 #ifndef STDCALL
164 #  if ITT_PLATFORM==ITT_PLATFORM_WIN
165 #    define STDCALL __stdcall
166 #  else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
167 #    if defined _M_IX86 || defined __i386__
168 #      define STDCALL __attribute__ ((stdcall))
169 #    else  /* _M_IX86 || __i386__ */
170 #      define STDCALL /* supported only on x86 platform */
171 #    endif /* _M_IX86 || __i386__ */
172 #  endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
173 #endif /* STDCALL */
174 
175 #define ITTAPI    ITTAPI_CDECL
176 #define LIBITTAPI ITTAPI_CDECL
177 
178 /* TODO: Temporary for compatibility! */
179 #define ITTAPI_CALL    ITTAPI_CDECL
180 #define LIBITTAPI_CALL ITTAPI_CDECL
181 
182 #if ITT_PLATFORM==ITT_PLATFORM_WIN
183 /* use __forceinline (VC++ specific) */
184 #define ITT_INLINE           __forceinline
185 #define ITT_INLINE_ATTRIBUTE /* nothing */
186 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
187 /*
188  * Generally, functions are not inlined unless optimization is specified.
189  * For functions declared inline, this attribute inlines the function even
190  * if no optimization level was specified.
191  */
192 #ifdef __STRICT_ANSI__
193 #define ITT_INLINE           static
194 #define ITT_INLINE_ATTRIBUTE __attribute__((unused))
195 #else  /* __STRICT_ANSI__ */
196 #define ITT_INLINE           static inline
197 #define ITT_INLINE_ATTRIBUTE __attribute__((always_inline, unused))
198 #endif /* __STRICT_ANSI__ */
199 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
200 /** @endcond */
201 
202 #ifdef INTEL_ITTNOTIFY_ENABLE_LEGACY
203 #  if ITT_PLATFORM==ITT_PLATFORM_WIN
204 #    pragma message("WARNING!!! Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro")
205 #  else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
206 #    warning "Deprecated API is used. Please undefine INTEL_ITTNOTIFY_ENABLE_LEGACY macro"
207 #  endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
208 #  include "legacy/ittnotify.h"
209 #endif /* INTEL_ITTNOTIFY_ENABLE_LEGACY */
210 
211 /** @cond exclude_from_documentation */
212 /* Helper macro for joining tokens */
213 #define ITT_JOIN_AUX(p,n) p##n
214 #define ITT_JOIN(p,n)     ITT_JOIN_AUX(p,n)
215 
216 #ifdef ITT_MAJOR
217 #undef ITT_MAJOR
218 #endif
219 #ifdef ITT_MINOR
220 #undef ITT_MINOR
221 #endif
222 #define ITT_MAJOR     3
223 #define ITT_MINOR     0
224 
225 /* Standard versioning of a token with major and minor version numbers */
226 #define ITT_VERSIONIZE(x)    \
227     ITT_JOIN(x,              \
228     ITT_JOIN(_,              \
229     ITT_JOIN(ITT_MAJOR,      \
230     ITT_JOIN(_, ITT_MINOR))))
231 
232 #ifndef INTEL_ITTNOTIFY_PREFIX
233 #  define INTEL_ITTNOTIFY_PREFIX __itt_
234 #endif /* INTEL_ITTNOTIFY_PREFIX */
235 #ifndef INTEL_ITTNOTIFY_POSTFIX
236 #  define INTEL_ITTNOTIFY_POSTFIX _ptr_
237 #endif /* INTEL_ITTNOTIFY_POSTFIX */
238 
239 #define ITTNOTIFY_NAME_AUX(n) ITT_JOIN(INTEL_ITTNOTIFY_PREFIX,n)
240 #define ITTNOTIFY_NAME(n)     ITT_VERSIONIZE(ITTNOTIFY_NAME_AUX(ITT_JOIN(n,INTEL_ITTNOTIFY_POSTFIX)))
241 
242 #define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
243 #define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)
244 
245 #define ITTNOTIFY_VOID_D0(n,d)       (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
246 #define ITTNOTIFY_VOID_D1(n,d,x)     (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
247 #define ITTNOTIFY_VOID_D2(n,d,x,y)   (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
248 #define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
249 #define ITTNOTIFY_VOID_D4(n,d,x,y,z,a)     (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
250 #define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b)   (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
251 #define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
252 #define ITTNOTIFY_DATA_D0(n,d)       (!(d)->flags) ?       0 : (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)(d)
253 #define ITTNOTIFY_DATA_D1(n,d,x)     (!(d)->flags) ?       0 : (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)(d,x)
254 #define ITTNOTIFY_DATA_D2(n,d,x,y)   (!(d)->flags) ?       0 : (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)(d,x,y)
255 #define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ?       0 : (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)(d,x,y,z)
256 #define ITTNOTIFY_DATA_D4(n,d,x,y,z,a)     (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
257 #define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b)   (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
258 #define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ?       0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
259 
260 #ifdef ITT_STUB
261 #undef ITT_STUB
262 #endif
263 #ifdef ITT_STUBV
264 #undef ITT_STUBV
265 #endif
266 #define ITT_STUBV(api,type,name,args)                             \
267     typedef type (api* ITT_JOIN(ITTNOTIFY_NAME(name),_t)) args;   \
268     extern ITT_JOIN(ITTNOTIFY_NAME(name),_t) ITTNOTIFY_NAME(name);
269 #define ITT_STUB ITT_STUBV
270 /** @endcond */
271 
272 #ifdef __cplusplus
273 extern "C" {
274 #endif /* __cplusplus */
275 
276 /** @cond exclude_from_gpa_documentation */
277 /**
278  * @defgroup public Public API
279  * @{
280  * @}
281  */
282 
283 /**
284  * @defgroup control Collection Control
285  * @ingroup public
286  * General behavior: application continues to run, but no profiling information is being collected
287  *
288  * Pausing occurs not only for the current thread but for all process as well as spawned processes
289  * - Intel(R) Parallel Inspector and Intel(R) Inspector XE:
290  *   - Does not analyze or report errors that involve memory access.
291  *   - Other errors are reported as usual. Pausing data collection in
292  *     Intel(R) Parallel Inspector and Intel(R) Inspector XE
293  *     only pauses tracing and analyzing memory access.
294  *     It does not pause tracing or analyzing threading APIs.
295  *   .
296  * - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
297  *   - Does continue to record when new threads are started.
298  *   .
299  * - Other effects:
300  *   - Possible reduction of runtime overhead.
301  *   .
302  * @{
303  */
304 /** @brief Pause collection */
305 void ITTAPI __itt_pause(void);
306 /** @brief Resume collection */
307 void ITTAPI __itt_resume(void);
308 /** @brief Detach collection */
309 void ITTAPI __itt_detach(void);
310 
311 /** @cond exclude_from_documentation */
312 #ifndef INTEL_NO_MACRO_BODY
313 #ifndef INTEL_NO_ITTNOTIFY_API
314 ITT_STUBV(ITTAPI, void, pause,  (void))
315 ITT_STUBV(ITTAPI, void, resume, (void))
316 ITT_STUBV(ITTAPI, void, detach, (void))
317 #define __itt_pause      ITTNOTIFY_VOID(pause)
318 #define __itt_pause_ptr  ITTNOTIFY_NAME(pause)
319 #define __itt_resume     ITTNOTIFY_VOID(resume)
320 #define __itt_resume_ptr ITTNOTIFY_NAME(resume)
321 #define __itt_detach     ITTNOTIFY_VOID(detach)
322 #define __itt_detach_ptr ITTNOTIFY_NAME(detach)
323 #else  /* INTEL_NO_ITTNOTIFY_API */
324 #define __itt_pause()
325 #define __itt_pause_ptr  0
326 #define __itt_resume()
327 #define __itt_resume_ptr 0
328 #define __itt_detach()
329 #define __itt_detach_ptr 0
330 #endif /* INTEL_NO_ITTNOTIFY_API */
331 #else  /* INTEL_NO_MACRO_BODY */
332 #define __itt_pause_ptr  0
333 #define __itt_resume_ptr 0
334 #define __itt_detach_ptr 0
335 #endif /* INTEL_NO_MACRO_BODY */
336 /** @endcond */
337 /** @} control group */
338 /** @endcond */
339 
340 /**
341  * @defgroup threads Threads
342  * @ingroup public
343  * Give names to threads
344  * @{
345  */
346 /**
347  * @brief Sets thread name of calling thread
348  * @param[in] name - name of thread
349  */
350 #if ITT_PLATFORM==ITT_PLATFORM_WIN
351 void ITTAPI __itt_thread_set_nameA(const char    *name);
352 void ITTAPI __itt_thread_set_nameW(const wchar_t *name);
353 #if defined(UNICODE) || defined(_UNICODE)
354 #  define __itt_thread_set_name     __itt_thread_set_nameW
355 #  define __itt_thread_set_name_ptr __itt_thread_set_nameW_ptr
356 #else /* UNICODE */
357 #  define __itt_thread_set_name     __itt_thread_set_nameA
358 #  define __itt_thread_set_name_ptr __itt_thread_set_nameA_ptr
359 #endif /* UNICODE */
360 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
361 void ITTAPI __itt_thread_set_name(const char *name);
362 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
363 
364 /** @cond exclude_from_documentation */
365 #ifndef INTEL_NO_MACRO_BODY
366 #ifndef INTEL_NO_ITTNOTIFY_API
367 #if ITT_PLATFORM==ITT_PLATFORM_WIN
368 ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char    *name))
369 ITT_STUBV(ITTAPI, void, thread_set_nameW, (const wchar_t *name))
370 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
371 ITT_STUBV(ITTAPI, void, thread_set_name,  (const char    *name))
372 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
373 #if ITT_PLATFORM==ITT_PLATFORM_WIN
374 #define __itt_thread_set_nameA     ITTNOTIFY_VOID(thread_set_nameA)
375 #define __itt_thread_set_nameA_ptr ITTNOTIFY_NAME(thread_set_nameA)
376 #define __itt_thread_set_nameW     ITTNOTIFY_VOID(thread_set_nameW)
377 #define __itt_thread_set_nameW_ptr ITTNOTIFY_NAME(thread_set_nameW)
378 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
379 #define __itt_thread_set_name     ITTNOTIFY_VOID(thread_set_name)
380 #define __itt_thread_set_name_ptr ITTNOTIFY_NAME(thread_set_name)
381 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
382 #else  /* INTEL_NO_ITTNOTIFY_API */
383 #if ITT_PLATFORM==ITT_PLATFORM_WIN
384 #define __itt_thread_set_nameA(name)
385 #define __itt_thread_set_nameA_ptr 0
386 #define __itt_thread_set_nameW(name)
387 #define __itt_thread_set_nameW_ptr 0
388 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
389 #define __itt_thread_set_name(name)
390 #define __itt_thread_set_name_ptr 0
391 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
392 #endif /* INTEL_NO_ITTNOTIFY_API */
393 #else  /* INTEL_NO_MACRO_BODY */
394 #if ITT_PLATFORM==ITT_PLATFORM_WIN
395 #define __itt_thread_set_nameA_ptr 0
396 #define __itt_thread_set_nameW_ptr 0
397 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
398 #define __itt_thread_set_name_ptr 0
399 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
400 #endif /* INTEL_NO_MACRO_BODY */
401 /** @endcond */
402 
403 /** @cond exclude_from_gpa_documentation */
404 
405 /**
406  * @brief Mark current thread as ignored from this point on, for the duration of its existence.
407  */
408 void ITTAPI __itt_thread_ignore(void);
409 
410 /** @cond exclude_from_documentation */
411 #ifndef INTEL_NO_MACRO_BODY
412 #ifndef INTEL_NO_ITTNOTIFY_API
413 ITT_STUBV(ITTAPI, void, thread_ignore, (void))
414 #define __itt_thread_ignore     ITTNOTIFY_VOID(thread_ignore)
415 #define __itt_thread_ignore_ptr ITTNOTIFY_NAME(thread_ignore)
416 #else  /* INTEL_NO_ITTNOTIFY_API */
417 #define __itt_thread_ignore()
418 #define __itt_thread_ignore_ptr 0
419 #endif /* INTEL_NO_ITTNOTIFY_API */
420 #else  /* INTEL_NO_MACRO_BODY */
421 #define __itt_thread_ignore_ptr 0
422 #endif /* INTEL_NO_MACRO_BODY */
423 /** @endcond */
424 /** @} threads group */
425 
426 /**
427  * @defgroup suppress Error suppression
428  * @ingroup public
429  * General behavior: application continues to run, but errors are suppressed
430  *
431  * @{
432  */
433 
434 /*****************************************************************//**
435  * @name group of functions used for error suppression in correctness tools
436  *********************************************************************/
437 /** @{ */
438 /**
439  * @hideinitializer
440  * @brief possible value for suppression mask
441  */
442 #define __itt_suppress_all_errors 0x7fffffff
443 
444 /**
445  * @hideinitializer
446  * @brief possible value for suppression mask (suppresses errors from threading analysis)
447  */
448 #define __itt_suppress_threading_errors 0x000000ff
449 
450 /**
451  * @hideinitializer
452  * @brief possible value for suppression mask (suppresses errors from memory analysis)
453  */
454 #define __itt_suppress_memory_errors 0x0000ff00
455 
456 /**
457  * @brief Start suppressing errors identified in mask on this thread
458  */
459 void ITTAPI __itt_suppress_push(unsigned int mask);
460 
461 /** @cond exclude_from_documentation */
462 #ifndef INTEL_NO_MACRO_BODY
463 #ifndef INTEL_NO_ITTNOTIFY_API
464 ITT_STUBV(ITTAPI, void, suppress_push, (unsigned int mask))
465 #define __itt_suppress_push     ITTNOTIFY_VOID(suppress_push)
466 #define __itt_suppress_push_ptr ITTNOTIFY_NAME(suppress_push)
467 #else  /* INTEL_NO_ITTNOTIFY_API */
468 #define __itt_suppress_push(mask)
469 #define __itt_suppress_push_ptr 0
470 #endif /* INTEL_NO_ITTNOTIFY_API */
471 #else  /* INTEL_NO_MACRO_BODY */
472 #define __itt_suppress_push_ptr 0
473 #endif /* INTEL_NO_MACRO_BODY */
474 /** @endcond */
475 
476 /**
477  * @brief Undo the effects of the matching call to __itt_suppress_push
478  */
479 void ITTAPI __itt_suppress_pop(void);
480 
481 /** @cond exclude_from_documentation */
482 #ifndef INTEL_NO_MACRO_BODY
483 #ifndef INTEL_NO_ITTNOTIFY_API
484 ITT_STUBV(ITTAPI, void, suppress_pop, (void))
485 #define __itt_suppress_pop     ITTNOTIFY_VOID(suppress_pop)
486 #define __itt_suppress_pop_ptr ITTNOTIFY_NAME(suppress_pop)
487 #else  /* INTEL_NO_ITTNOTIFY_API */
488 #define __itt_suppress_pop()
489 #define __itt_suppress_pop_ptr 0
490 #endif /* INTEL_NO_ITTNOTIFY_API */
491 #else  /* INTEL_NO_MACRO_BODY */
492 #define __itt_suppress_pop_ptr 0
493 #endif /* INTEL_NO_MACRO_BODY */
494 /** @endcond */
495 
496 /**
497  * @enum __itt_model_disable
498  * @brief Enumerator for the disable methods
499  */
500 typedef enum __itt_suppress_mode {
501     __itt_unsuppress_range,
502     __itt_suppress_range
503 } __itt_suppress_mode_t;
504 
505 /**
506  * @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
507  */
508 void ITTAPI __itt_suppress_mark_range(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size);
509 
510 /** @cond exclude_from_documentation */
511 #ifndef INTEL_NO_MACRO_BODY
512 #ifndef INTEL_NO_ITTNOTIFY_API
513 ITT_STUBV(ITTAPI, void, suppress_mark_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size))
514 #define __itt_suppress_mark_range     ITTNOTIFY_VOID(suppress_mark_range)
515 #define __itt_suppress_mark_range_ptr ITTNOTIFY_NAME(suppress_mark_range)
516 #else  /* INTEL_NO_ITTNOTIFY_API */
517 #define __itt_suppress_mark_range(mask)
518 #define __itt_suppress_mark_range_ptr 0
519 #endif /* INTEL_NO_ITTNOTIFY_API */
520 #else  /* INTEL_NO_MACRO_BODY */
521 #define __itt_suppress_mark_range_ptr 0
522 #endif /* INTEL_NO_MACRO_BODY */
523 /** @endcond */
524 
525 /**
526  * @brief Undo the effect of a matching call to __itt_suppress_mark_range.   If not matching
527  *        call is found, nothing is changed.
528  */
529 void ITTAPI __itt_suppress_clear_range(__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size);
530 
531 /** @cond exclude_from_documentation */
532 #ifndef INTEL_NO_MACRO_BODY
533 #ifndef INTEL_NO_ITTNOTIFY_API
534 ITT_STUBV(ITTAPI, void, suppress_clear_range, (__itt_suppress_mode_t mode, unsigned int mask, void * address, size_t size))
535 #define __itt_suppress_clear_range     ITTNOTIFY_VOID(suppress_clear_range)
536 #define __itt_suppress_clear_range_ptr ITTNOTIFY_NAME(suppress_clear_range)
537 #else  /* INTEL_NO_ITTNOTIFY_API */
538 #define __itt_suppress_clear_range(mask)
539 #define __itt_suppress_clear_range_ptr 0
540 #endif /* INTEL_NO_ITTNOTIFY_API */
541 #else  /* INTEL_NO_MACRO_BODY */
542 #define __itt_suppress_clear_range_ptr 0
543 #endif /* INTEL_NO_MACRO_BODY */
544 /** @endcond */
545 /** @} */
546 /** @} suppress group */
547 
548 /**
549  * @defgroup sync Synchronization
550  * @ingroup public
551  * Indicate user-written synchronization code
552  * @{
553  */
554 /**
555  * @hideinitializer
556  * @brief possible value of attribute argument for sync object type
557  */
558 #define __itt_attr_barrier 1
559 
560 /**
561  * @hideinitializer
562  * @brief possible value of attribute argument for sync object type
563  */
564 #define __itt_attr_mutex   2
565 
566 /**
567 @brief Name a synchronization object
568 @param[in] addr       Handle for the synchronization object. You should
569 use a real address to uniquely identify the synchronization object.
570 @param[in] objtype    null-terminated object type string. If NULL is
571 passed, the name will be "User Synchronization".
572 @param[in] objname    null-terminated object name string. If NULL,
573 no name will be assigned to the object.
574 @param[in] attribute  one of [#__itt_attr_barrier, #__itt_attr_mutex]
575  */
576 
577 #if ITT_PLATFORM==ITT_PLATFORM_WIN
578 void ITTAPI __itt_sync_createA(void *addr, const char    *objtype, const char    *objname, int attribute);
579 void ITTAPI __itt_sync_createW(void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute);
580 #if defined(UNICODE) || defined(_UNICODE)
581 #  define __itt_sync_create     __itt_sync_createW
582 #  define __itt_sync_create_ptr __itt_sync_createW_ptr
583 #else /* UNICODE */
584 #  define __itt_sync_create     __itt_sync_createA
585 #  define __itt_sync_create_ptr __itt_sync_createA_ptr
586 #endif /* UNICODE */
587 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
588 void ITTAPI __itt_sync_create (void *addr, const char *objtype, const char *objname, int attribute);
589 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
590 
591 /** @cond exclude_from_documentation */
592 #ifndef INTEL_NO_MACRO_BODY
593 #ifndef INTEL_NO_ITTNOTIFY_API
594 #if ITT_PLATFORM==ITT_PLATFORM_WIN
595 ITT_STUBV(ITTAPI, void, sync_createA, (void *addr, const char    *objtype, const char    *objname, int attribute))
596 ITT_STUBV(ITTAPI, void, sync_createW, (void *addr, const wchar_t *objtype, const wchar_t *objname, int attribute))
597 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
598 ITT_STUBV(ITTAPI, void, sync_create,  (void *addr, const char*    objtype, const char*    objname, int attribute))
599 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
600 #if ITT_PLATFORM==ITT_PLATFORM_WIN
601 #define __itt_sync_createA     ITTNOTIFY_VOID(sync_createA)
602 #define __itt_sync_createA_ptr ITTNOTIFY_NAME(sync_createA)
603 #define __itt_sync_createW     ITTNOTIFY_VOID(sync_createW)
604 #define __itt_sync_createW_ptr ITTNOTIFY_NAME(sync_createW)
605 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
606 #define __itt_sync_create     ITTNOTIFY_VOID(sync_create)
607 #define __itt_sync_create_ptr ITTNOTIFY_NAME(sync_create)
608 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
609 #else  /* INTEL_NO_ITTNOTIFY_API */
610 #if ITT_PLATFORM==ITT_PLATFORM_WIN
611 #define __itt_sync_createA(addr, objtype, objname, attribute)
612 #define __itt_sync_createA_ptr 0
613 #define __itt_sync_createW(addr, objtype, objname, attribute)
614 #define __itt_sync_createW_ptr 0
615 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
616 #define __itt_sync_create(addr, objtype, objname, attribute)
617 #define __itt_sync_create_ptr 0
618 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
619 #endif /* INTEL_NO_ITTNOTIFY_API */
620 #else  /* INTEL_NO_MACRO_BODY */
621 #if ITT_PLATFORM==ITT_PLATFORM_WIN
622 #define __itt_sync_createA_ptr 0
623 #define __itt_sync_createW_ptr 0
624 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
625 #define __itt_sync_create_ptr 0
626 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
627 #endif /* INTEL_NO_MACRO_BODY */
628 /** @endcond */
629 
630 /**
631 @brief Rename a synchronization object
632 
633 You can use the rename call to assign or reassign a name to a given
634 synchronization object.
635 @param[in] addr  handle for the synchronization object.
636 @param[in] name  null-terminated object name string.
637 */
638 #if ITT_PLATFORM==ITT_PLATFORM_WIN
639 void ITTAPI __itt_sync_renameA(void *addr, const char    *name);
640 void ITTAPI __itt_sync_renameW(void *addr, const wchar_t *name);
641 #if defined(UNICODE) || defined(_UNICODE)
642 #  define __itt_sync_rename     __itt_sync_renameW
643 #  define __itt_sync_rename_ptr __itt_sync_renameW_ptr
644 #else /* UNICODE */
645 #  define __itt_sync_rename     __itt_sync_renameA
646 #  define __itt_sync_rename_ptr __itt_sync_renameA_ptr
647 #endif /* UNICODE */
648 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
649 void ITTAPI __itt_sync_rename(void *addr, const char *name);
650 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
651 
652 /** @cond exclude_from_documentation */
653 #ifndef INTEL_NO_MACRO_BODY
654 #ifndef INTEL_NO_ITTNOTIFY_API
655 #if ITT_PLATFORM==ITT_PLATFORM_WIN
656 ITT_STUBV(ITTAPI, void, sync_renameA, (void *addr, const char    *name))
657 ITT_STUBV(ITTAPI, void, sync_renameW, (void *addr, const wchar_t *name))
658 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
659 ITT_STUBV(ITTAPI, void, sync_rename,  (void *addr, const char    *name))
660 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
661 #if ITT_PLATFORM==ITT_PLATFORM_WIN
662 #define __itt_sync_renameA     ITTNOTIFY_VOID(sync_renameA)
663 #define __itt_sync_renameA_ptr ITTNOTIFY_NAME(sync_renameA)
664 #define __itt_sync_renameW     ITTNOTIFY_VOID(sync_renameW)
665 #define __itt_sync_renameW_ptr ITTNOTIFY_NAME(sync_renameW)
666 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
667 #define __itt_sync_rename     ITTNOTIFY_VOID(sync_rename)
668 #define __itt_sync_rename_ptr ITTNOTIFY_NAME(sync_rename)
669 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
670 #else  /* INTEL_NO_ITTNOTIFY_API */
671 #if ITT_PLATFORM==ITT_PLATFORM_WIN
672 #define __itt_sync_renameA(addr, name)
673 #define __itt_sync_renameA_ptr 0
674 #define __itt_sync_renameW(addr, name)
675 #define __itt_sync_renameW_ptr 0
676 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
677 #define __itt_sync_rename(addr, name)
678 #define __itt_sync_rename_ptr 0
679 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
680 #endif /* INTEL_NO_ITTNOTIFY_API */
681 #else  /* INTEL_NO_MACRO_BODY */
682 #if ITT_PLATFORM==ITT_PLATFORM_WIN
683 #define __itt_sync_renameA_ptr 0
684 #define __itt_sync_renameW_ptr 0
685 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
686 #define __itt_sync_rename_ptr 0
687 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
688 #endif /* INTEL_NO_MACRO_BODY */
689 /** @endcond */
690 
691 /**
692  @brief Destroy a synchronization object.
693  @param addr Handle for the synchronization object.
694  */
695 void ITTAPI __itt_sync_destroy(void *addr);
696 
697 /** @cond exclude_from_documentation */
698 #ifndef INTEL_NO_MACRO_BODY
699 #ifndef INTEL_NO_ITTNOTIFY_API
700 ITT_STUBV(ITTAPI, void, sync_destroy, (void *addr))
701 #define __itt_sync_destroy     ITTNOTIFY_VOID(sync_destroy)
702 #define __itt_sync_destroy_ptr ITTNOTIFY_NAME(sync_destroy)
703 #else  /* INTEL_NO_ITTNOTIFY_API */
704 #define __itt_sync_destroy(addr)
705 #define __itt_sync_destroy_ptr 0
706 #endif /* INTEL_NO_ITTNOTIFY_API */
707 #else  /* INTEL_NO_MACRO_BODY */
708 #define __itt_sync_destroy_ptr 0
709 #endif /* INTEL_NO_MACRO_BODY */
710 /** @endcond */
711 
712 /*****************************************************************//**
713  * @name group of functions is used for performance measurement tools
714  *********************************************************************/
715 /** @{ */
716 /**
717  * @brief Enter spin loop on user-defined sync object
718  */
719 void ITTAPI __itt_sync_prepare(void* addr);
720 
721 /** @cond exclude_from_documentation */
722 #ifndef INTEL_NO_MACRO_BODY
723 #ifndef INTEL_NO_ITTNOTIFY_API
724 ITT_STUBV(ITTAPI, void, sync_prepare, (void *addr))
725 #define __itt_sync_prepare     ITTNOTIFY_VOID(sync_prepare)
726 #define __itt_sync_prepare_ptr ITTNOTIFY_NAME(sync_prepare)
727 #else  /* INTEL_NO_ITTNOTIFY_API */
728 #define __itt_sync_prepare(addr)
729 #define __itt_sync_prepare_ptr 0
730 #endif /* INTEL_NO_ITTNOTIFY_API */
731 #else  /* INTEL_NO_MACRO_BODY */
732 #define __itt_sync_prepare_ptr 0
733 #endif /* INTEL_NO_MACRO_BODY */
734 /** @endcond */
735 
736 /**
737  * @brief Quit spin loop without acquiring spin object
738  */
739 void ITTAPI __itt_sync_cancel(void *addr);
740 
741 /** @cond exclude_from_documentation */
742 #ifndef INTEL_NO_MACRO_BODY
743 #ifndef INTEL_NO_ITTNOTIFY_API
744 ITT_STUBV(ITTAPI, void, sync_cancel, (void *addr))
745 #define __itt_sync_cancel     ITTNOTIFY_VOID(sync_cancel)
746 #define __itt_sync_cancel_ptr ITTNOTIFY_NAME(sync_cancel)
747 #else  /* INTEL_NO_ITTNOTIFY_API */
748 #define __itt_sync_cancel(addr)
749 #define __itt_sync_cancel_ptr 0
750 #endif /* INTEL_NO_ITTNOTIFY_API */
751 #else  /* INTEL_NO_MACRO_BODY */
752 #define __itt_sync_cancel_ptr 0
753 #endif /* INTEL_NO_MACRO_BODY */
754 /** @endcond */
755 
756 /**
757  * @brief Successful spin loop completion (sync object acquired)
758  */
759 void ITTAPI __itt_sync_acquired(void *addr);
760 
761 /** @cond exclude_from_documentation */
762 #ifndef INTEL_NO_MACRO_BODY
763 #ifndef INTEL_NO_ITTNOTIFY_API
764 ITT_STUBV(ITTAPI, void, sync_acquired, (void *addr))
765 #define __itt_sync_acquired     ITTNOTIFY_VOID(sync_acquired)
766 #define __itt_sync_acquired_ptr ITTNOTIFY_NAME(sync_acquired)
767 #else  /* INTEL_NO_ITTNOTIFY_API */
768 #define __itt_sync_acquired(addr)
769 #define __itt_sync_acquired_ptr 0
770 #endif /* INTEL_NO_ITTNOTIFY_API */
771 #else  /* INTEL_NO_MACRO_BODY */
772 #define __itt_sync_acquired_ptr 0
773 #endif /* INTEL_NO_MACRO_BODY */
774 /** @endcond */
775 
776 /**
777  * @brief Start sync object releasing code. Is called before the lock release call.
778  */
779 void ITTAPI __itt_sync_releasing(void* addr);
780 
781 /** @cond exclude_from_documentation */
782 #ifndef INTEL_NO_MACRO_BODY
783 #ifndef INTEL_NO_ITTNOTIFY_API
784 ITT_STUBV(ITTAPI, void, sync_releasing, (void *addr))
785 #define __itt_sync_releasing     ITTNOTIFY_VOID(sync_releasing)
786 #define __itt_sync_releasing_ptr ITTNOTIFY_NAME(sync_releasing)
787 #else  /* INTEL_NO_ITTNOTIFY_API */
788 #define __itt_sync_releasing(addr)
789 #define __itt_sync_releasing_ptr 0
790 #endif /* INTEL_NO_ITTNOTIFY_API */
791 #else  /* INTEL_NO_MACRO_BODY */
792 #define __itt_sync_releasing_ptr 0
793 #endif /* INTEL_NO_MACRO_BODY */
794 /** @endcond */
795 /** @} */
796 
797 /** @} sync group */
798 
799 /**************************************************************//**
800  * @name group of functions is used for correctness checking tools
801  ******************************************************************/
802 /** @{ */
803 /**
804  * @ingroup legacy
805  * @deprecated Legacy API
806  * @brief Fast synchronization which does no require spinning.
807  * - This special function is to be used by TBB and OpenMP libraries only when they know
808  *   there is no spin but they need to suppress TC warnings about shared variable modifications.
809  * - It only has corresponding pointers in static library and does not have corresponding function
810  *   in dynamic library.
811  * @see void __itt_sync_prepare(void* addr);
812  */
813 void ITTAPI __itt_fsync_prepare(void* addr);
814 
815 /** @cond exclude_from_documentation */
816 #ifndef INTEL_NO_MACRO_BODY
817 #ifndef INTEL_NO_ITTNOTIFY_API
818 ITT_STUBV(ITTAPI, void, fsync_prepare, (void *addr))
819 #define __itt_fsync_prepare     ITTNOTIFY_VOID(fsync_prepare)
820 #define __itt_fsync_prepare_ptr ITTNOTIFY_NAME(fsync_prepare)
821 #else  /* INTEL_NO_ITTNOTIFY_API */
822 #define __itt_fsync_prepare(addr)
823 #define __itt_fsync_prepare_ptr 0
824 #endif /* INTEL_NO_ITTNOTIFY_API */
825 #else  /* INTEL_NO_MACRO_BODY */
826 #define __itt_fsync_prepare_ptr 0
827 #endif /* INTEL_NO_MACRO_BODY */
828 /** @endcond */
829 
830 /**
831  * @ingroup legacy
832  * @deprecated Legacy API
833  * @brief Fast synchronization which does no require spinning.
834  * - This special function is to be used by TBB and OpenMP libraries only when they know
835  *   there is no spin but they need to suppress TC warnings about shared variable modifications.
836  * - It only has corresponding pointers in static library and does not have corresponding function
837  *   in dynamic library.
838  * @see void __itt_sync_cancel(void *addr);
839  */
840 void ITTAPI __itt_fsync_cancel(void *addr);
841 
842 /** @cond exclude_from_documentation */
843 #ifndef INTEL_NO_MACRO_BODY
844 #ifndef INTEL_NO_ITTNOTIFY_API
845 ITT_STUBV(ITTAPI, void, fsync_cancel, (void *addr))
846 #define __itt_fsync_cancel     ITTNOTIFY_VOID(fsync_cancel)
847 #define __itt_fsync_cancel_ptr ITTNOTIFY_NAME(fsync_cancel)
848 #else  /* INTEL_NO_ITTNOTIFY_API */
849 #define __itt_fsync_cancel(addr)
850 #define __itt_fsync_cancel_ptr 0
851 #endif /* INTEL_NO_ITTNOTIFY_API */
852 #else  /* INTEL_NO_MACRO_BODY */
853 #define __itt_fsync_cancel_ptr 0
854 #endif /* INTEL_NO_MACRO_BODY */
855 /** @endcond */
856 
857 /**
858  * @ingroup legacy
859  * @deprecated Legacy API
860  * @brief Fast synchronization which does no require spinning.
861  * - This special function is to be used by TBB and OpenMP libraries only when they know
862  *   there is no spin but they need to suppress TC warnings about shared variable modifications.
863  * - It only has corresponding pointers in static library and does not have corresponding function
864  *   in dynamic library.
865  * @see void __itt_sync_acquired(void *addr);
866  */
867 void ITTAPI __itt_fsync_acquired(void *addr);
868 
869 /** @cond exclude_from_documentation */
870 #ifndef INTEL_NO_MACRO_BODY
871 #ifndef INTEL_NO_ITTNOTIFY_API
872 ITT_STUBV(ITTAPI, void, fsync_acquired, (void *addr))
873 #define __itt_fsync_acquired     ITTNOTIFY_VOID(fsync_acquired)
874 #define __itt_fsync_acquired_ptr ITTNOTIFY_NAME(fsync_acquired)
875 #else  /* INTEL_NO_ITTNOTIFY_API */
876 #define __itt_fsync_acquired(addr)
877 #define __itt_fsync_acquired_ptr 0
878 #endif /* INTEL_NO_ITTNOTIFY_API */
879 #else  /* INTEL_NO_MACRO_BODY */
880 #define __itt_fsync_acquired_ptr 0
881 #endif /* INTEL_NO_MACRO_BODY */
882 /** @endcond */
883 
884 /**
885  * @ingroup legacy
886  * @deprecated Legacy API
887  * @brief Fast synchronization which does no require spinning.
888  * - This special function is to be used by TBB and OpenMP libraries only when they know
889  *   there is no spin but they need to suppress TC warnings about shared variable modifications.
890  * - It only has corresponding pointers in static library and does not have corresponding function
891  *   in dynamic library.
892  * @see void __itt_sync_releasing(void* addr);
893  */
894 void ITTAPI __itt_fsync_releasing(void* addr);
895 
896 /** @cond exclude_from_documentation */
897 #ifndef INTEL_NO_MACRO_BODY
898 #ifndef INTEL_NO_ITTNOTIFY_API
899 ITT_STUBV(ITTAPI, void, fsync_releasing, (void *addr))
900 #define __itt_fsync_releasing     ITTNOTIFY_VOID(fsync_releasing)
901 #define __itt_fsync_releasing_ptr ITTNOTIFY_NAME(fsync_releasing)
902 #else  /* INTEL_NO_ITTNOTIFY_API */
903 #define __itt_fsync_releasing(addr)
904 #define __itt_fsync_releasing_ptr 0
905 #endif /* INTEL_NO_ITTNOTIFY_API */
906 #else  /* INTEL_NO_MACRO_BODY */
907 #define __itt_fsync_releasing_ptr 0
908 #endif /* INTEL_NO_MACRO_BODY */
909 /** @endcond */
910 /** @} */
911 
912 /**
913  * @defgroup model Modeling by Intel(R) Parallel Advisor
914  * @ingroup public
915  * This is the subset of itt used for modeling by Intel(R) Parallel Advisor.
916  * This API is called ONLY using annotate.h, by "Annotation" macros
917  * the user places in their sources during the parallelism modeling steps.
918  *
919  * site_begin/end and task_begin/end take the address of handle variables,
920  * which are writeable by the API.  Handles must be 0 initialized prior
921  * to the first call to begin, or may cause a run-time failure.
922  * The handles are initialized in a multi-thread safe way by the API if
923  * the handle is 0.  The commonly expected idiom is one static handle to
924  * identify a site or task.  If a site or task of the same name has already
925  * been started during this collection, the same handle MAY be returned,
926  * but is not required to be - it is unspecified if data merging is done
927  * based on name.  These routines also take an instance variable.  Like
928  * the lexical instance, these must be 0 initialized.  Unlike the lexical
929  * instance, this is used to track a single dynamic instance.
930  *
931  * API used by the Intel(R) Parallel Advisor to describe potential concurrency
932  * and related activities. User-added source annotations expand to calls
933  * to these procedures to enable modeling of a hypothetical concurrent
934  * execution serially.
935  * @{
936  */
937 #if !defined(_ADVISOR_ANNOTATE_H_) || defined(ANNOTATE_EXPAND_NULL)
938 
939 typedef void* __itt_model_site;             /*!< @brief handle for lexical site     */
940 typedef void* __itt_model_site_instance;    /*!< @brief handle for dynamic instance */
941 typedef void* __itt_model_task;             /*!< @brief handle for lexical site     */
942 typedef void* __itt_model_task_instance;    /*!< @brief handle for dynamic instance */
943 
944 /**
945  * @enum __itt_model_disable
946  * @brief Enumerator for the disable methods
947  */
948 typedef enum {
949     __itt_model_disable_observation,
950     __itt_model_disable_collection
951 } __itt_model_disable;
952 
953 #endif /* !_ADVISOR_ANNOTATE_H_ || ANNOTATE_EXPAND_NULL */
954 
955 /**
956  * @brief ANNOTATE_SITE_BEGIN/ANNOTATE_SITE_END support.
957  *
958  * site_begin/end model a potential concurrency site.
959  * site instances may be recursively nested with themselves.
960  * site_end exits the most recently started but unended site for the current
961  * thread.  The handle passed to end may be used to validate structure.
962  * Instances of a site encountered on different threads concurrently
963  * are considered completely distinct. If the site name for two different
964  * lexical sites match, it is unspecified whether they are treated as the
965  * same or different for data presentation.
966  */
967 void ITTAPI __itt_model_site_begin(__itt_model_site *site, __itt_model_site_instance *instance, const char *name);
968 #if ITT_PLATFORM==ITT_PLATFORM_WIN
969 void ITTAPI __itt_model_site_beginW(const wchar_t *name);
970 #endif
971 void ITTAPI __itt_model_site_beginA(const char *name);
972 void ITTAPI __itt_model_site_beginAL(const char *name, size_t siteNameLen);
973 void ITTAPI __itt_model_site_end  (__itt_model_site *site, __itt_model_site_instance *instance);
974 void ITTAPI __itt_model_site_end_2(void);
975 
976 /** @cond exclude_from_documentation */
977 #ifndef INTEL_NO_MACRO_BODY
978 #ifndef INTEL_NO_ITTNOTIFY_API
979 ITT_STUBV(ITTAPI, void, model_site_begin,  (__itt_model_site *site, __itt_model_site_instance *instance, const char *name))
980 #if ITT_PLATFORM==ITT_PLATFORM_WIN
981 ITT_STUBV(ITTAPI, void, model_site_beginW,  (const wchar_t *name))
982 #endif
983 ITT_STUBV(ITTAPI, void, model_site_beginA,  (const char *name))
984 ITT_STUBV(ITTAPI, void, model_site_beginAL,  (const char *name, size_t siteNameLen))
985 ITT_STUBV(ITTAPI, void, model_site_end,    (__itt_model_site *site, __itt_model_site_instance *instance))
986 ITT_STUBV(ITTAPI, void, model_site_end_2,  (void))
987 #define __itt_model_site_begin      ITTNOTIFY_VOID(model_site_begin)
988 #define __itt_model_site_begin_ptr  ITTNOTIFY_NAME(model_site_begin)
989 #if ITT_PLATFORM==ITT_PLATFORM_WIN
990 #define __itt_model_site_beginW      ITTNOTIFY_VOID(model_site_beginW)
991 #define __itt_model_site_beginW_ptr  ITTNOTIFY_NAME(model_site_beginW)
992 #endif
993 #define __itt_model_site_beginA      ITTNOTIFY_VOID(model_site_beginA)
994 #define __itt_model_site_beginA_ptr  ITTNOTIFY_NAME(model_site_beginA)
995 #define __itt_model_site_beginAL      ITTNOTIFY_VOID(model_site_beginAL)
996 #define __itt_model_site_beginAL_ptr  ITTNOTIFY_NAME(model_site_beginAL)
997 #define __itt_model_site_end        ITTNOTIFY_VOID(model_site_end)
998 #define __itt_model_site_end_ptr    ITTNOTIFY_NAME(model_site_end)
999 #define __itt_model_site_end_2        ITTNOTIFY_VOID(model_site_end_2)
1000 #define __itt_model_site_end_2_ptr    ITTNOTIFY_NAME(model_site_end_2)
1001 #else  /* INTEL_NO_ITTNOTIFY_API */
1002 #define __itt_model_site_begin(site, instance, name)
1003 #define __itt_model_site_begin_ptr  0
1004 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1005 #define __itt_model_site_beginW(name)
1006 #define __itt_model_site_beginW_ptr  0
1007 #endif
1008 #define __itt_model_site_beginA(name)
1009 #define __itt_model_site_beginA_ptr  0
1010 #define __itt_model_site_beginAL(name, siteNameLen)
1011 #define __itt_model_site_beginAL_ptr  0
1012 #define __itt_model_site_end(site, instance)
1013 #define __itt_model_site_end_ptr    0
1014 #define __itt_model_site_end_2()
1015 #define __itt_model_site_end_2_ptr    0
1016 #endif /* INTEL_NO_ITTNOTIFY_API */
1017 #else  /* INTEL_NO_MACRO_BODY */
1018 #define __itt_model_site_begin_ptr  0
1019 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1020 #define __itt_model_site_beginW_ptr  0
1021 #endif
1022 #define __itt_model_site_beginA_ptr  0
1023 #define __itt_model_site_beginAL_ptr  0
1024 #define __itt_model_site_end_ptr    0
1025 #define __itt_model_site_end_2_ptr    0
1026 #endif /* INTEL_NO_MACRO_BODY */
1027 /** @endcond */
1028 
1029 /**
1030  * @brief ANNOTATE_TASK_BEGIN/ANNOTATE_TASK_END support
1031  *
1032  * task_begin/end model a potential task, which is contained within the most
1033  * closely enclosing dynamic site.  task_end exits the most recently started
1034  * but unended task.  The handle passed to end may be used to validate
1035  * structure.  It is unspecified if bad dynamic nesting is detected.  If it
1036  * is, it should be encoded in the resulting data collection.  The collector
1037  * should not fail due to construct nesting issues, nor attempt to directly
1038  * indicate the problem.
1039  */
1040 void ITTAPI __itt_model_task_begin(__itt_model_task *task, __itt_model_task_instance *instance, const char *name);
1041 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1042 void ITTAPI __itt_model_task_beginW(const wchar_t *name);
1043 void ITTAPI __itt_model_iteration_taskW(const wchar_t *name);
1044 #endif
1045 void ITTAPI __itt_model_task_beginA(const char *name);
1046 void ITTAPI __itt_model_task_beginAL(const char *name, size_t taskNameLen);
1047 void ITTAPI __itt_model_iteration_taskA(const char *name);
1048 void ITTAPI __itt_model_iteration_taskAL(const char *name, size_t taskNameLen);
1049 void ITTAPI __itt_model_task_end  (__itt_model_task *task, __itt_model_task_instance *instance);
1050 void ITTAPI __itt_model_task_end_2(void);
1051 
1052 /** @cond exclude_from_documentation */
1053 #ifndef INTEL_NO_MACRO_BODY
1054 #ifndef INTEL_NO_ITTNOTIFY_API
1055 ITT_STUBV(ITTAPI, void, model_task_begin,  (__itt_model_task *task, __itt_model_task_instance *instance, const char *name))
1056 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1057 ITT_STUBV(ITTAPI, void, model_task_beginW,  (const wchar_t *name))
1058 ITT_STUBV(ITTAPI, void, model_iteration_taskW, (const wchar_t *name))
1059 #endif
1060 ITT_STUBV(ITTAPI, void, model_task_beginA,  (const char *name))
1061 ITT_STUBV(ITTAPI, void, model_task_beginAL,  (const char *name, size_t taskNameLen))
1062 ITT_STUBV(ITTAPI, void, model_iteration_taskA,  (const char *name))
1063 ITT_STUBV(ITTAPI, void, model_iteration_taskAL,  (const char *name, size_t taskNameLen))
1064 ITT_STUBV(ITTAPI, void, model_task_end,    (__itt_model_task *task, __itt_model_task_instance *instance))
1065 ITT_STUBV(ITTAPI, void, model_task_end_2,  (void))
1066 #define __itt_model_task_begin      ITTNOTIFY_VOID(model_task_begin)
1067 #define __itt_model_task_begin_ptr  ITTNOTIFY_NAME(model_task_begin)
1068 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1069 #define __itt_model_task_beginW     ITTNOTIFY_VOID(model_task_beginW)
1070 #define __itt_model_task_beginW_ptr ITTNOTIFY_NAME(model_task_beginW)
1071 #define __itt_model_iteration_taskW     ITTNOTIFY_VOID(model_iteration_taskW)
1072 #define __itt_model_iteration_taskW_ptr ITTNOTIFY_NAME(model_iteration_taskW)
1073 #endif
1074 #define __itt_model_task_beginA    ITTNOTIFY_VOID(model_task_beginA)
1075 #define __itt_model_task_beginA_ptr ITTNOTIFY_NAME(model_task_beginA)
1076 #define __itt_model_task_beginAL    ITTNOTIFY_VOID(model_task_beginAL)
1077 #define __itt_model_task_beginAL_ptr ITTNOTIFY_NAME(model_task_beginAL)
1078 #define __itt_model_iteration_taskA    ITTNOTIFY_VOID(model_iteration_taskA)
1079 #define __itt_model_iteration_taskA_ptr ITTNOTIFY_NAME(model_iteration_taskA)
1080 #define __itt_model_iteration_taskAL    ITTNOTIFY_VOID(model_iteration_taskAL)
1081 #define __itt_model_iteration_taskAL_ptr ITTNOTIFY_NAME(model_iteration_taskAL)
1082 #define __itt_model_task_end        ITTNOTIFY_VOID(model_task_end)
1083 #define __itt_model_task_end_ptr    ITTNOTIFY_NAME(model_task_end)
1084 #define __itt_model_task_end_2        ITTNOTIFY_VOID(model_task_end_2)
1085 #define __itt_model_task_end_2_ptr    ITTNOTIFY_NAME(model_task_end_2)
1086 #else  /* INTEL_NO_ITTNOTIFY_API */
1087 #define __itt_model_task_begin(task, instance, name)
1088 #define __itt_model_task_begin_ptr  0
1089 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1090 #define __itt_model_task_beginW(name)
1091 #define __itt_model_task_beginW_ptr  0
1092 #endif
1093 #define __itt_model_task_beginA(name)
1094 #define __itt_model_task_beginA_ptr  0
1095 #define __itt_model_task_beginAL(name, siteNameLen)
1096 #define __itt_model_task_beginAL_ptr  0
1097 #define __itt_model_iteration_taskA(name)
1098 #define __itt_model_iteration_taskA_ptr  0
1099 #define __itt_model_iteration_taskAL(name, siteNameLen)
1100 #define __itt_model_iteration_taskAL_ptr  0
1101 #define __itt_model_task_end(task, instance)
1102 #define __itt_model_task_end_ptr    0
1103 #define __itt_model_task_end_2()
1104 #define __itt_model_task_end_2_ptr    0
1105 #endif /* INTEL_NO_ITTNOTIFY_API */
1106 #else  /* INTEL_NO_MACRO_BODY */
1107 #define __itt_model_task_begin_ptr  0
1108 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1109 #define __itt_model_task_beginW_ptr 0
1110 #endif
1111 #define __itt_model_task_beginA_ptr  0
1112 #define __itt_model_task_beginAL_ptr  0
1113 #define __itt_model_iteration_taskA_ptr    0
1114 #define __itt_model_iteration_taskAL_ptr    0
1115 #define __itt_model_task_end_ptr    0
1116 #define __itt_model_task_end_2_ptr    0
1117 #endif /* INTEL_NO_MACRO_BODY */
1118 /** @endcond */
1119 
1120 /**
1121  * @brief ANNOTATE_LOCK_ACQUIRE/ANNOTATE_LOCK_RELEASE support
1122  *
1123  * lock_acquire/release model a potential lock for both lockset and
1124  * performance modeling.  Each unique address is modeled as a separate
1125  * lock, with invalid addresses being valid lock IDs.  Specifically:
1126  * no storage is accessed by the API at the specified address - it is only
1127  * used for lock identification.  Lock acquires may be self-nested and are
1128  * unlocked by a corresponding number of releases.
1129  * (These closely correspond to __itt_sync_acquired/__itt_sync_releasing,
1130  * but may not have identical semantics.)
1131  */
1132 void ITTAPI __itt_model_lock_acquire(void *lock);
1133 void ITTAPI __itt_model_lock_acquire_2(void *lock);
1134 void ITTAPI __itt_model_lock_release(void *lock);
1135 void ITTAPI __itt_model_lock_release_2(void *lock);
1136 
1137 /** @cond exclude_from_documentation */
1138 #ifndef INTEL_NO_MACRO_BODY
1139 #ifndef INTEL_NO_ITTNOTIFY_API
1140 ITT_STUBV(ITTAPI, void, model_lock_acquire, (void *lock))
1141 ITT_STUBV(ITTAPI, void, model_lock_acquire_2, (void *lock))
1142 ITT_STUBV(ITTAPI, void, model_lock_release, (void *lock))
1143 ITT_STUBV(ITTAPI, void, model_lock_release_2, (void *lock))
1144 #define __itt_model_lock_acquire     ITTNOTIFY_VOID(model_lock_acquire)
1145 #define __itt_model_lock_acquire_ptr ITTNOTIFY_NAME(model_lock_acquire)
1146 #define __itt_model_lock_acquire_2     ITTNOTIFY_VOID(model_lock_acquire_2)
1147 #define __itt_model_lock_acquire_2_ptr ITTNOTIFY_NAME(model_lock_acquire_2)
1148 #define __itt_model_lock_release     ITTNOTIFY_VOID(model_lock_release)
1149 #define __itt_model_lock_release_ptr ITTNOTIFY_NAME(model_lock_release)
1150 #define __itt_model_lock_release_2     ITTNOTIFY_VOID(model_lock_release_2)
1151 #define __itt_model_lock_release_2_ptr ITTNOTIFY_NAME(model_lock_release_2)
1152 #else  /* INTEL_NO_ITTNOTIFY_API */
1153 #define __itt_model_lock_acquire(lock)
1154 #define __itt_model_lock_acquire_ptr 0
1155 #define __itt_model_lock_acquire_2(lock)
1156 #define __itt_model_lock_acquire_2_ptr 0
1157 #define __itt_model_lock_release(lock)
1158 #define __itt_model_lock_release_ptr 0
1159 #define __itt_model_lock_release_2(lock)
1160 #define __itt_model_lock_release_2_ptr 0
1161 #endif /* INTEL_NO_ITTNOTIFY_API */
1162 #else  /* INTEL_NO_MACRO_BODY */
1163 #define __itt_model_lock_acquire_ptr 0
1164 #define __itt_model_lock_acquire_2_ptr 0
1165 #define __itt_model_lock_release_ptr 0
1166 #define __itt_model_lock_release_2_ptr 0
1167 #endif /* INTEL_NO_MACRO_BODY */
1168 /** @endcond */
1169 
1170 /**
1171  * @brief ANNOTATE_RECORD_ALLOCATION/ANNOTATE_RECORD_DEALLOCATION support
1172  *
1173  * record_allocation/deallocation describe user-defined memory allocator
1174  * behavior, which may be required for correctness modeling to understand
1175  * when storage is not expected to be actually reused across threads.
1176  */
1177 void ITTAPI __itt_model_record_allocation  (void *addr, size_t size);
1178 void ITTAPI __itt_model_record_deallocation(void *addr);
1179 
1180 /** @cond exclude_from_documentation */
1181 #ifndef INTEL_NO_MACRO_BODY
1182 #ifndef INTEL_NO_ITTNOTIFY_API
1183 ITT_STUBV(ITTAPI, void, model_record_allocation,   (void *addr, size_t size))
1184 ITT_STUBV(ITTAPI, void, model_record_deallocation, (void *addr))
1185 #define __itt_model_record_allocation       ITTNOTIFY_VOID(model_record_allocation)
1186 #define __itt_model_record_allocation_ptr   ITTNOTIFY_NAME(model_record_allocation)
1187 #define __itt_model_record_deallocation     ITTNOTIFY_VOID(model_record_deallocation)
1188 #define __itt_model_record_deallocation_ptr ITTNOTIFY_NAME(model_record_deallocation)
1189 #else  /* INTEL_NO_ITTNOTIFY_API */
1190 #define __itt_model_record_allocation(addr, size)
1191 #define __itt_model_record_allocation_ptr   0
1192 #define __itt_model_record_deallocation(addr)
1193 #define __itt_model_record_deallocation_ptr 0
1194 #endif /* INTEL_NO_ITTNOTIFY_API */
1195 #else  /* INTEL_NO_MACRO_BODY */
1196 #define __itt_model_record_allocation_ptr   0
1197 #define __itt_model_record_deallocation_ptr 0
1198 #endif /* INTEL_NO_MACRO_BODY */
1199 /** @endcond */
1200 
1201 /**
1202  * @brief ANNOTATE_INDUCTION_USES support
1203  *
1204  * Note particular storage is inductive through the end of the current site
1205  */
1206 void ITTAPI __itt_model_induction_uses(void* addr, size_t size);
1207 
1208 /** @cond exclude_from_documentation */
1209 #ifndef INTEL_NO_MACRO_BODY
1210 #ifndef INTEL_NO_ITTNOTIFY_API
1211 ITT_STUBV(ITTAPI, void, model_induction_uses, (void *addr, size_t size))
1212 #define __itt_model_induction_uses     ITTNOTIFY_VOID(model_induction_uses)
1213 #define __itt_model_induction_uses_ptr ITTNOTIFY_NAME(model_induction_uses)
1214 #else  /* INTEL_NO_ITTNOTIFY_API */
1215 #define __itt_model_induction_uses(addr, size)
1216 #define __itt_model_induction_uses_ptr   0
1217 #endif /* INTEL_NO_ITTNOTIFY_API */
1218 #else  /* INTEL_NO_MACRO_BODY */
1219 #define __itt_model_induction_uses_ptr   0
1220 #endif /* INTEL_NO_MACRO_BODY */
1221 /** @endcond */
1222 
1223 /**
1224  * @brief ANNOTATE_REDUCTION_USES support
1225  *
1226  * Note particular storage is used for reduction through the end
1227  * of the current site
1228  */
1229 void ITTAPI __itt_model_reduction_uses(void* addr, size_t size);
1230 
1231 /** @cond exclude_from_documentation */
1232 #ifndef INTEL_NO_MACRO_BODY
1233 #ifndef INTEL_NO_ITTNOTIFY_API
1234 ITT_STUBV(ITTAPI, void, model_reduction_uses, (void *addr, size_t size))
1235 #define __itt_model_reduction_uses     ITTNOTIFY_VOID(model_reduction_uses)
1236 #define __itt_model_reduction_uses_ptr ITTNOTIFY_NAME(model_reduction_uses)
1237 #else  /* INTEL_NO_ITTNOTIFY_API */
1238 #define __itt_model_reduction_uses(addr, size)
1239 #define __itt_model_reduction_uses_ptr   0
1240 #endif /* INTEL_NO_ITTNOTIFY_API */
1241 #else  /* INTEL_NO_MACRO_BODY */
1242 #define __itt_model_reduction_uses_ptr   0
1243 #endif /* INTEL_NO_MACRO_BODY */
1244 /** @endcond */
1245 
1246 /**
1247  * @brief ANNOTATE_OBSERVE_USES support
1248  *
1249  * Have correctness modeling record observations about uses of storage
1250  * through the end of the current site
1251  */
1252 void ITTAPI __itt_model_observe_uses(void* addr, size_t size);
1253 
1254 /** @cond exclude_from_documentation */
1255 #ifndef INTEL_NO_MACRO_BODY
1256 #ifndef INTEL_NO_ITTNOTIFY_API
1257 ITT_STUBV(ITTAPI, void, model_observe_uses, (void *addr, size_t size))
1258 #define __itt_model_observe_uses     ITTNOTIFY_VOID(model_observe_uses)
1259 #define __itt_model_observe_uses_ptr ITTNOTIFY_NAME(model_observe_uses)
1260 #else  /* INTEL_NO_ITTNOTIFY_API */
1261 #define __itt_model_observe_uses(addr, size)
1262 #define __itt_model_observe_uses_ptr   0
1263 #endif /* INTEL_NO_ITTNOTIFY_API */
1264 #else  /* INTEL_NO_MACRO_BODY */
1265 #define __itt_model_observe_uses_ptr   0
1266 #endif /* INTEL_NO_MACRO_BODY */
1267 /** @endcond */
1268 
1269 /**
1270  * @brief ANNOTATE_CLEAR_USES support
1271  *
1272  * Clear the special handling of a piece of storage related to induction,
1273  * reduction or observe_uses
1274  */
1275 void ITTAPI __itt_model_clear_uses(void* addr);
1276 
1277 /** @cond exclude_from_documentation */
1278 #ifndef INTEL_NO_MACRO_BODY
1279 #ifndef INTEL_NO_ITTNOTIFY_API
1280 ITT_STUBV(ITTAPI, void, model_clear_uses, (void *addr))
1281 #define __itt_model_clear_uses     ITTNOTIFY_VOID(model_clear_uses)
1282 #define __itt_model_clear_uses_ptr ITTNOTIFY_NAME(model_clear_uses)
1283 #else  /* INTEL_NO_ITTNOTIFY_API */
1284 #define __itt_model_clear_uses(addr)
1285 #define __itt_model_clear_uses_ptr 0
1286 #endif /* INTEL_NO_ITTNOTIFY_API */
1287 #else  /* INTEL_NO_MACRO_BODY */
1288 #define __itt_model_clear_uses_ptr 0
1289 #endif /* INTEL_NO_MACRO_BODY */
1290 /** @endcond */
1291 
1292 /**
1293  * @brief ANNOTATE_DISABLE_*_PUSH/ANNOTATE_DISABLE_*_POP support
1294  *
1295  * disable_push/disable_pop push and pop disabling based on a parameter.
1296  * Disabling observations stops processing of memory references during
1297  * correctness modeling, and all annotations that occur in the disabled
1298  * region.  This allows description of code that is expected to be handled
1299  * specially during conversion to parallelism or that is not recognized
1300  * by tools (e.g. some kinds of synchronization operations.)
1301  * This mechanism causes all annotations in the disabled region, other
1302  * than disable_push and disable_pop, to be ignored.  (For example, this
1303  * might validly be used to disable an entire parallel site and the contained
1304  * tasks and locking in it for data collection purposes.)
1305  * The disable for collection is a more expensive operation, but reduces
1306  * collector overhead significantly.  This applies to BOTH correctness data
1307  * collection and performance data collection.  For example, a site
1308  * containing a task might only enable data collection for the first 10
1309  * iterations.  Both performance and correctness data should reflect this,
1310  * and the program should run as close to full speed as possible when
1311  * collection is disabled.
1312  */
1313 void ITTAPI __itt_model_disable_push(__itt_model_disable x);
1314 void ITTAPI __itt_model_disable_pop(void);
1315 void ITTAPI __itt_model_aggregate_task(size_t x);
1316 
1317 /** @cond exclude_from_documentation */
1318 #ifndef INTEL_NO_MACRO_BODY
1319 #ifndef INTEL_NO_ITTNOTIFY_API
1320 ITT_STUBV(ITTAPI, void, model_disable_push, (__itt_model_disable x))
1321 ITT_STUBV(ITTAPI, void, model_disable_pop,  (void))
1322 ITT_STUBV(ITTAPI, void, model_aggregate_task, (size_t x))
1323 #define __itt_model_disable_push     ITTNOTIFY_VOID(model_disable_push)
1324 #define __itt_model_disable_push_ptr ITTNOTIFY_NAME(model_disable_push)
1325 #define __itt_model_disable_pop      ITTNOTIFY_VOID(model_disable_pop)
1326 #define __itt_model_disable_pop_ptr  ITTNOTIFY_NAME(model_disable_pop)
1327 #define __itt_model_aggregate_task      ITTNOTIFY_VOID(model_aggregate_task)
1328 #define __itt_model_aggregate_task_ptr  ITTNOTIFY_NAME(model_aggregate_task)
1329 #else  /* INTEL_NO_ITTNOTIFY_API */
1330 #define __itt_model_disable_push(x)
1331 #define __itt_model_disable_push_ptr 0
1332 #define __itt_model_disable_pop()
1333 #define __itt_model_disable_pop_ptr 0
1334 #define __itt_model_aggregate_task(x)
1335 #define __itt_model_aggregate_task_ptr 0
1336 #endif /* INTEL_NO_ITTNOTIFY_API */
1337 #else  /* INTEL_NO_MACRO_BODY */
1338 #define __itt_model_disable_push_ptr 0
1339 #define __itt_model_disable_pop_ptr 0
1340 #define __itt_model_aggregate_task_ptr 0
1341 #endif /* INTEL_NO_MACRO_BODY */
1342 /** @endcond */
1343 /** @} model group */
1344 
1345 /**
1346  * @defgroup heap Heap
1347  * @ingroup public
1348  * Heap group
1349  * @{
1350  */
1351 
1352 typedef void* __itt_heap_function;
1353 
1354 /**
1355  * @brief Create an identification for heap function
1356  * @return non-zero identifier or NULL
1357  */
1358 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1359 __itt_heap_function ITTAPI __itt_heap_function_createA(const char*    name, const char*    domain);
1360 __itt_heap_function ITTAPI __itt_heap_function_createW(const wchar_t* name, const wchar_t* domain);
1361 #if defined(UNICODE) || defined(_UNICODE)
1362 #  define __itt_heap_function_create     __itt_heap_function_createW
1363 #  define __itt_heap_function_create_ptr __itt_heap_function_createW_ptr
1364 #else
1365 #  define __itt_heap_function_create     __itt_heap_function_createA
1366 #  define __itt_heap_function_create_ptr __itt_heap_function_createA_ptr
1367 #endif /* UNICODE */
1368 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1369 __itt_heap_function ITTAPI __itt_heap_function_create(const char* name, const char* domain);
1370 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1371 
1372 /** @cond exclude_from_documentation */
1373 #ifndef INTEL_NO_MACRO_BODY
1374 #ifndef INTEL_NO_ITTNOTIFY_API
1375 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1376 ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createA, (const char*    name, const char*    domain))
1377 ITT_STUB(ITTAPI, __itt_heap_function, heap_function_createW, (const wchar_t* name, const wchar_t* domain))
1378 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1379 ITT_STUB(ITTAPI, __itt_heap_function, heap_function_create,  (const char*    name, const char*    domain))
1380 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1381 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1382 #define __itt_heap_function_createA     ITTNOTIFY_DATA(heap_function_createA)
1383 #define __itt_heap_function_createA_ptr ITTNOTIFY_NAME(heap_function_createA)
1384 #define __itt_heap_function_createW     ITTNOTIFY_DATA(heap_function_createW)
1385 #define __itt_heap_function_createW_ptr ITTNOTIFY_NAME(heap_function_createW)
1386 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1387 #define __itt_heap_function_create      ITTNOTIFY_DATA(heap_function_create)
1388 #define __itt_heap_function_create_ptr  ITTNOTIFY_NAME(heap_function_create)
1389 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1390 #else  /* INTEL_NO_ITTNOTIFY_API */
1391 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1392 #define __itt_heap_function_createA(name, domain) (__itt_heap_function)0
1393 #define __itt_heap_function_createA_ptr 0
1394 #define __itt_heap_function_createW(name, domain) (__itt_heap_function)0
1395 #define __itt_heap_function_createW_ptr 0
1396 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1397 #define __itt_heap_function_create(name, domain)  (__itt_heap_function)0
1398 #define __itt_heap_function_create_ptr  0
1399 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1400 #endif /* INTEL_NO_ITTNOTIFY_API */
1401 #else  /* INTEL_NO_MACRO_BODY */
1402 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1403 #define __itt_heap_function_createA_ptr 0
1404 #define __itt_heap_function_createW_ptr 0
1405 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1406 #define __itt_heap_function_create_ptr  0
1407 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1408 #endif /* INTEL_NO_MACRO_BODY */
1409 /** @endcond */
1410 
1411 /**
1412  * @brief Record an allocation begin occurrence.
1413  */
1414 void ITTAPI __itt_heap_allocate_begin(__itt_heap_function h, size_t size, int initialized);
1415 
1416 /** @cond exclude_from_documentation */
1417 #ifndef INTEL_NO_MACRO_BODY
1418 #ifndef INTEL_NO_ITTNOTIFY_API
1419 ITT_STUBV(ITTAPI, void, heap_allocate_begin, (__itt_heap_function h, size_t size, int initialized))
1420 #define __itt_heap_allocate_begin     ITTNOTIFY_VOID(heap_allocate_begin)
1421 #define __itt_heap_allocate_begin_ptr ITTNOTIFY_NAME(heap_allocate_begin)
1422 #else  /* INTEL_NO_ITTNOTIFY_API */
1423 #define __itt_heap_allocate_begin(h, size, initialized)
1424 #define __itt_heap_allocate_begin_ptr   0
1425 #endif /* INTEL_NO_ITTNOTIFY_API */
1426 #else  /* INTEL_NO_MACRO_BODY */
1427 #define __itt_heap_allocate_begin_ptr   0
1428 #endif /* INTEL_NO_MACRO_BODY */
1429 /** @endcond */
1430 
1431 /**
1432  * @brief Record an allocation end occurrence.
1433  */
1434 void ITTAPI __itt_heap_allocate_end(__itt_heap_function h, void** addr, size_t size, int initialized);
1435 
1436 /** @cond exclude_from_documentation */
1437 #ifndef INTEL_NO_MACRO_BODY
1438 #ifndef INTEL_NO_ITTNOTIFY_API
1439 ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr, size_t size, int initialized))
1440 #define __itt_heap_allocate_end     ITTNOTIFY_VOID(heap_allocate_end)
1441 #define __itt_heap_allocate_end_ptr ITTNOTIFY_NAME(heap_allocate_end)
1442 #else  /* INTEL_NO_ITTNOTIFY_API */
1443 #define __itt_heap_allocate_end(h, addr, size, initialized)
1444 #define __itt_heap_allocate_end_ptr   0
1445 #endif /* INTEL_NO_ITTNOTIFY_API */
1446 #else  /* INTEL_NO_MACRO_BODY */
1447 #define __itt_heap_allocate_end_ptr   0
1448 #endif /* INTEL_NO_MACRO_BODY */
1449 /** @endcond */
1450 
1451 /**
1452  * @brief Record an free begin occurrence.
1453  */
1454 void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void* addr);
1455 
1456 /** @cond exclude_from_documentation */
1457 #ifndef INTEL_NO_MACRO_BODY
1458 #ifndef INTEL_NO_ITTNOTIFY_API
1459 ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr))
1460 #define __itt_heap_free_begin     ITTNOTIFY_VOID(heap_free_begin)
1461 #define __itt_heap_free_begin_ptr ITTNOTIFY_NAME(heap_free_begin)
1462 #else  /* INTEL_NO_ITTNOTIFY_API */
1463 #define __itt_heap_free_begin(h, addr)
1464 #define __itt_heap_free_begin_ptr   0
1465 #endif /* INTEL_NO_ITTNOTIFY_API */
1466 #else  /* INTEL_NO_MACRO_BODY */
1467 #define __itt_heap_free_begin_ptr   0
1468 #endif /* INTEL_NO_MACRO_BODY */
1469 /** @endcond */
1470 
1471 /**
1472  * @brief Record an free end occurrence.
1473  */
1474 void ITTAPI __itt_heap_free_end(__itt_heap_function h, void* addr);
1475 
1476 /** @cond exclude_from_documentation */
1477 #ifndef INTEL_NO_MACRO_BODY
1478 #ifndef INTEL_NO_ITTNOTIFY_API
1479 ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr))
1480 #define __itt_heap_free_end     ITTNOTIFY_VOID(heap_free_end)
1481 #define __itt_heap_free_end_ptr ITTNOTIFY_NAME(heap_free_end)
1482 #else  /* INTEL_NO_ITTNOTIFY_API */
1483 #define __itt_heap_free_end(h, addr)
1484 #define __itt_heap_free_end_ptr   0
1485 #endif /* INTEL_NO_ITTNOTIFY_API */
1486 #else  /* INTEL_NO_MACRO_BODY */
1487 #define __itt_heap_free_end_ptr   0
1488 #endif /* INTEL_NO_MACRO_BODY */
1489 /** @endcond */
1490 
1491 /**
1492  * @brief Record an reallocation begin occurrence.
1493  */
1494 void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void* addr, size_t new_size, int initialized);
1495 
1496 /** @cond exclude_from_documentation */
1497 #ifndef INTEL_NO_MACRO_BODY
1498 #ifndef INTEL_NO_ITTNOTIFY_API
1499 ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* addr, size_t new_size, int initialized))
1500 #define __itt_heap_reallocate_begin     ITTNOTIFY_VOID(heap_reallocate_begin)
1501 #define __itt_heap_reallocate_begin_ptr ITTNOTIFY_NAME(heap_reallocate_begin)
1502 #else  /* INTEL_NO_ITTNOTIFY_API */
1503 #define __itt_heap_reallocate_begin(h, addr, new_size, initialized)
1504 #define __itt_heap_reallocate_begin_ptr   0
1505 #endif /* INTEL_NO_ITTNOTIFY_API */
1506 #else  /* INTEL_NO_MACRO_BODY */
1507 #define __itt_heap_reallocate_begin_ptr   0
1508 #endif /* INTEL_NO_MACRO_BODY */
1509 /** @endcond */
1510 
1511 /**
1512  * @brief Record an reallocation end occurrence.
1513  */
1514 void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized);
1515 
1516 /** @cond exclude_from_documentation */
1517 #ifndef INTEL_NO_MACRO_BODY
1518 #ifndef INTEL_NO_ITTNOTIFY_API
1519 ITT_STUBV(ITTAPI, void, heap_reallocate_end, (__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized))
1520 #define __itt_heap_reallocate_end     ITTNOTIFY_VOID(heap_reallocate_end)
1521 #define __itt_heap_reallocate_end_ptr ITTNOTIFY_NAME(heap_reallocate_end)
1522 #else  /* INTEL_NO_ITTNOTIFY_API */
1523 #define __itt_heap_reallocate_end(h, addr, new_addr, new_size, initialized)
1524 #define __itt_heap_reallocate_end_ptr   0
1525 #endif /* INTEL_NO_ITTNOTIFY_API */
1526 #else  /* INTEL_NO_MACRO_BODY */
1527 #define __itt_heap_reallocate_end_ptr   0
1528 #endif /* INTEL_NO_MACRO_BODY */
1529 /** @endcond */
1530 
1531 /** @brief internal access begin */
1532 void ITTAPI __itt_heap_internal_access_begin(void);
1533 
1534 /** @cond exclude_from_documentation */
1535 #ifndef INTEL_NO_MACRO_BODY
1536 #ifndef INTEL_NO_ITTNOTIFY_API
1537 ITT_STUBV(ITTAPI, void, heap_internal_access_begin,  (void))
1538 #define __itt_heap_internal_access_begin      ITTNOTIFY_VOID(heap_internal_access_begin)
1539 #define __itt_heap_internal_access_begin_ptr  ITTNOTIFY_NAME(heap_internal_access_begin)
1540 #else  /* INTEL_NO_ITTNOTIFY_API */
1541 #define __itt_heap_internal_access_begin()
1542 #define __itt_heap_internal_access_begin_ptr  0
1543 #endif /* INTEL_NO_ITTNOTIFY_API */
1544 #else  /* INTEL_NO_MACRO_BODY */
1545 #define __itt_heap_internal_access_begin_ptr  0
1546 #endif /* INTEL_NO_MACRO_BODY */
1547 /** @endcond */
1548 
1549 /** @brief internal access end */
1550 void ITTAPI __itt_heap_internal_access_end(void);
1551 
1552 /** @cond exclude_from_documentation */
1553 #ifndef INTEL_NO_MACRO_BODY
1554 #ifndef INTEL_NO_ITTNOTIFY_API
1555 ITT_STUBV(ITTAPI, void, heap_internal_access_end, (void))
1556 #define __itt_heap_internal_access_end     ITTNOTIFY_VOID(heap_internal_access_end)
1557 #define __itt_heap_internal_access_end_ptr ITTNOTIFY_NAME(heap_internal_access_end)
1558 #else  /* INTEL_NO_ITTNOTIFY_API */
1559 #define __itt_heap_internal_access_end()
1560 #define __itt_heap_internal_access_end_ptr 0
1561 #endif /* INTEL_NO_ITTNOTIFY_API */
1562 #else  /* INTEL_NO_MACRO_BODY */
1563 #define __itt_heap_internal_access_end_ptr 0
1564 #endif /* INTEL_NO_MACRO_BODY */
1565 /** @endcond */
1566 
1567 /** @brief record memory growth begin */
1568 void ITTAPI __itt_heap_record_memory_growth_begin(void);
1569 
1570 /** @cond exclude_from_documentation */
1571 #ifndef INTEL_NO_MACRO_BODY
1572 #ifndef INTEL_NO_ITTNOTIFY_API
1573 ITT_STUBV(ITTAPI, void, heap_record_memory_growth_begin,  (void))
1574 #define __itt_heap_record_memory_growth_begin      ITTNOTIFY_VOID(heap_record_memory_growth_begin)
1575 #define __itt_heap_record_memory_growth_begin_ptr  ITTNOTIFY_NAME(heap_record_memory_growth_begin)
1576 #else  /* INTEL_NO_ITTNOTIFY_API */
1577 #define __itt_heap_record_memory_growth_begin()
1578 #define __itt_heap_record_memory_growth_begin_ptr  0
1579 #endif /* INTEL_NO_ITTNOTIFY_API */
1580 #else  /* INTEL_NO_MACRO_BODY */
1581 #define __itt_heap_record_memory_growth_begin_ptr  0
1582 #endif /* INTEL_NO_MACRO_BODY */
1583 /** @endcond */
1584 
1585 /** @brief record memory growth end */
1586 void ITTAPI __itt_heap_record_memory_growth_end(void);
1587 
1588 /** @cond exclude_from_documentation */
1589 #ifndef INTEL_NO_MACRO_BODY
1590 #ifndef INTEL_NO_ITTNOTIFY_API
1591 ITT_STUBV(ITTAPI, void, heap_record_memory_growth_end, (void))
1592 #define __itt_heap_record_memory_growth_end     ITTNOTIFY_VOID(heap_record_memory_growth_end)
1593 #define __itt_heap_record_memory_growth_end_ptr ITTNOTIFY_NAME(heap_record_memory_growth_end)
1594 #else  /* INTEL_NO_ITTNOTIFY_API */
1595 #define __itt_heap_record_memory_growth_end()
1596 #define __itt_heap_record_memory_growth_end_ptr 0
1597 #endif /* INTEL_NO_ITTNOTIFY_API */
1598 #else  /* INTEL_NO_MACRO_BODY */
1599 #define __itt_heap_record_memory_growth_end_ptr 0
1600 #endif /* INTEL_NO_MACRO_BODY */
1601 /** @endcond */
1602 
1603 /**
1604  * @brief Specify the type of heap detection/reporting to modify.
1605  */
1606 /**
1607  * @hideinitializer
1608  * @brief Report on memory leaks.
1609  */
1610 #define __itt_heap_leaks 0x00000001
1611 
1612 /**
1613  * @hideinitializer
1614  * @brief Report on memory growth.
1615  */
1616 #define __itt_heap_growth 0x00000002
1617 
1618 
1619 /** @brief heap reset detection */
1620 void ITTAPI __itt_heap_reset_detection(unsigned int reset_mask);
1621 
1622 /** @cond exclude_from_documentation */
1623 #ifndef INTEL_NO_MACRO_BODY
1624 #ifndef INTEL_NO_ITTNOTIFY_API
1625 ITT_STUBV(ITTAPI, void, heap_reset_detection,  (unsigned int reset_mask))
1626 #define __itt_heap_reset_detection      ITTNOTIFY_VOID(heap_reset_detection)
1627 #define __itt_heap_reset_detection_ptr  ITTNOTIFY_NAME(heap_reset_detection)
1628 #else  /* INTEL_NO_ITTNOTIFY_API */
1629 #define __itt_heap_reset_detection()
1630 #define __itt_heap_reset_detection_ptr  0
1631 #endif /* INTEL_NO_ITTNOTIFY_API */
1632 #else  /* INTEL_NO_MACRO_BODY */
1633 #define __itt_heap_reset_detection_ptr  0
1634 #endif /* INTEL_NO_MACRO_BODY */
1635 /** @endcond */
1636 
1637 /** @brief report */
1638 void ITTAPI __itt_heap_record(unsigned int record_mask);
1639 
1640 /** @cond exclude_from_documentation */
1641 #ifndef INTEL_NO_MACRO_BODY
1642 #ifndef INTEL_NO_ITTNOTIFY_API
1643 ITT_STUBV(ITTAPI, void, heap_record, (unsigned int record_mask))
1644 #define __itt_heap_record     ITTNOTIFY_VOID(heap_record)
1645 #define __itt_heap_record_ptr ITTNOTIFY_NAME(heap_record)
1646 #else  /* INTEL_NO_ITTNOTIFY_API */
1647 #define __itt_heap_record()
1648 #define __itt_heap_record_ptr 0
1649 #endif /* INTEL_NO_ITTNOTIFY_API */
1650 #else  /* INTEL_NO_MACRO_BODY */
1651 #define __itt_heap_record_ptr 0
1652 #endif /* INTEL_NO_MACRO_BODY */
1653 /** @endcond */
1654 
1655 /** @} heap group */
1656 /** @endcond */
1657 /* ========================================================================== */
1658 
1659 /**
1660  * @defgroup domains Domains
1661  * @ingroup public
1662  * Domains group
1663  * @{
1664  */
1665 
1666 /** @cond exclude_from_documentation */
1667 #pragma pack(push, 8)
1668 
1669 typedef struct ___itt_domain
1670 {
1671     volatile int flags; /*!< Zero if disabled, non-zero if enabled. The meaning of different non-zero values is reserved to the runtime */
1672     const char* nameA;  /*!< Copy of original name in ASCII. */
1673 #if defined(UNICODE) || defined(_UNICODE)
1674     const wchar_t* nameW; /*!< Copy of original name in UNICODE. */
1675 #else  /* UNICODE || _UNICODE */
1676     void* nameW;
1677 #endif /* UNICODE || _UNICODE */
1678     int   extra1; /*!< Reserved to the runtime */
1679     void* extra2; /*!< Reserved to the runtime */
1680     struct ___itt_domain* next;
1681 } __itt_domain;
1682 
1683 #pragma pack(pop)
1684 /** @endcond */
1685 
1686 /**
1687  * @ingroup domains
1688  * @brief Create a domain.
1689  * Create domain using some domain name: the URI naming style is recommended.
1690  * Because the set of domains is expected to be static over the application's
1691  * execution time, there is no mechanism to destroy a domain.
1692  * Any domain can be accessed by any thread in the process, regardless of
1693  * which thread created the domain. This call is thread-safe.
1694  * @param[in] name name of domain
1695  */
1696 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1697 __itt_domain* ITTAPI __itt_domain_createA(const char    *name);
1698 __itt_domain* ITTAPI __itt_domain_createW(const wchar_t *name);
1699 #if defined(UNICODE) || defined(_UNICODE)
1700 #  define __itt_domain_create     __itt_domain_createW
1701 #  define __itt_domain_create_ptr __itt_domain_createW_ptr
1702 #else /* UNICODE */
1703 #  define __itt_domain_create     __itt_domain_createA
1704 #  define __itt_domain_create_ptr __itt_domain_createA_ptr
1705 #endif /* UNICODE */
1706 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1707 __itt_domain* ITTAPI __itt_domain_create(const char *name);
1708 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1709 
1710 /** @cond exclude_from_documentation */
1711 #ifndef INTEL_NO_MACRO_BODY
1712 #ifndef INTEL_NO_ITTNOTIFY_API
1713 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1714 ITT_STUB(ITTAPI, __itt_domain*, domain_createA, (const char    *name))
1715 ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name))
1716 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1717 ITT_STUB(ITTAPI, __itt_domain*, domain_create,  (const char    *name))
1718 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1719 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1720 #define __itt_domain_createA     ITTNOTIFY_DATA(domain_createA)
1721 #define __itt_domain_createA_ptr ITTNOTIFY_NAME(domain_createA)
1722 #define __itt_domain_createW     ITTNOTIFY_DATA(domain_createW)
1723 #define __itt_domain_createW_ptr ITTNOTIFY_NAME(domain_createW)
1724 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1725 #define __itt_domain_create     ITTNOTIFY_DATA(domain_create)
1726 #define __itt_domain_create_ptr ITTNOTIFY_NAME(domain_create)
1727 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1728 #else  /* INTEL_NO_ITTNOTIFY_API */
1729 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1730 #define __itt_domain_createA(name) (__itt_domain*)0
1731 #define __itt_domain_createA_ptr 0
1732 #define __itt_domain_createW(name) (__itt_domain*)0
1733 #define __itt_domain_createW_ptr 0
1734 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1735 #define __itt_domain_create(name)  (__itt_domain*)0
1736 #define __itt_domain_create_ptr 0
1737 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1738 #endif /* INTEL_NO_ITTNOTIFY_API */
1739 #else  /* INTEL_NO_MACRO_BODY */
1740 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1741 #define __itt_domain_createA_ptr 0
1742 #define __itt_domain_createW_ptr 0
1743 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1744 #define __itt_domain_create_ptr  0
1745 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1746 #endif /* INTEL_NO_MACRO_BODY */
1747 /** @endcond */
1748 /** @} domains group */
1749 
1750 /**
1751  * @defgroup ids IDs
1752  * @ingroup public
1753  * IDs group
1754  * @{
1755  */
1756 
1757 /** @cond exclude_from_documentation */
1758 #pragma pack(push, 8)
1759 
1760 typedef struct ___itt_id
1761 {
1762     unsigned long long d1, d2, d3;
1763 } __itt_id;
1764 
1765 #pragma pack(pop)
1766 /** @endcond */
1767 
1768 static const __itt_id __itt_null = { 0, 0, 0 };
1769 
1770 /**
1771  * @ingroup ids
1772  * @brief A convenience function is provided to create an ID without domain control.
1773  * @brief This is a convenience function to initialize an __itt_id structure. This function
1774  * does not affect the collector runtime in any way. After you make the ID with this
1775  * function, you still must create it with the __itt_id_create function before using the ID
1776  * to identify a named entity.
1777  * @param[in] addr The address of object; high QWORD of the ID value.
1778  * @param[in] extra The extra data to unique identify object; low QWORD of the ID value.
1779  */
1780 
1781 ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra) ITT_INLINE_ATTRIBUTE;
__itt_id_make(void * addr,unsigned long long extra)1782 ITT_INLINE __itt_id ITTAPI __itt_id_make(void* addr, unsigned long long extra)
1783 {
1784     __itt_id id = __itt_null;
1785     id.d1 = (unsigned long long)((uintptr_t)addr);
1786     id.d2 = (unsigned long long)extra;
1787     id.d3 = (unsigned long long)0; /* Reserved. Must be zero */
1788     return id;
1789 }
1790 
1791 /**
1792  * @ingroup ids
1793  * @brief Create an instance of identifier.
1794  * This establishes the beginning of the lifetime of an instance of
1795  * the given ID in the trace. Once this lifetime starts, the ID
1796  * can be used to tag named entity instances in calls such as
1797  * __itt_task_begin, and to specify relationships among
1798  * identified named entity instances, using the \ref relations APIs.
1799  * Instance IDs are not domain specific!
1800  * @param[in] domain The domain controlling the execution of this call.
1801  * @param[in] id The ID to create.
1802  */
1803 void ITTAPI __itt_id_create(const __itt_domain *domain, __itt_id id);
1804 
1805 /** @cond exclude_from_documentation */
1806 #ifndef INTEL_NO_MACRO_BODY
1807 #ifndef INTEL_NO_ITTNOTIFY_API
1808 ITT_STUBV(ITTAPI, void, id_create, (const __itt_domain *domain, __itt_id id))
1809 #define __itt_id_create(d,x) ITTNOTIFY_VOID_D1(id_create,d,x)
1810 #define __itt_id_create_ptr  ITTNOTIFY_NAME(id_create)
1811 #else  /* INTEL_NO_ITTNOTIFY_API */
1812 #define __itt_id_create(domain,id)
1813 #define __itt_id_create_ptr 0
1814 #endif /* INTEL_NO_ITTNOTIFY_API */
1815 #else  /* INTEL_NO_MACRO_BODY */
1816 #define __itt_id_create_ptr 0
1817 #endif /* INTEL_NO_MACRO_BODY */
1818 /** @endcond */
1819 
1820 /**
1821  * @ingroup ids
1822  * @brief Destroy an instance of identifier.
1823  * This ends the lifetime of the current instance of the given ID value in the trace.
1824  * Any relationships that are established after this lifetime ends are invalid.
1825  * This call must be performed before the given ID value can be reused for a different
1826  * named entity instance.
1827  * @param[in] domain The domain controlling the execution of this call.
1828  * @param[in] id The ID to destroy.
1829  */
1830 void ITTAPI __itt_id_destroy(const __itt_domain *domain, __itt_id id);
1831 
1832 /** @cond exclude_from_documentation */
1833 #ifndef INTEL_NO_MACRO_BODY
1834 #ifndef INTEL_NO_ITTNOTIFY_API
1835 ITT_STUBV(ITTAPI, void, id_destroy, (const __itt_domain *domain, __itt_id id))
1836 #define __itt_id_destroy(d,x) ITTNOTIFY_VOID_D1(id_destroy,d,x)
1837 #define __itt_id_destroy_ptr  ITTNOTIFY_NAME(id_destroy)
1838 #else  /* INTEL_NO_ITTNOTIFY_API */
1839 #define __itt_id_destroy(domain,id)
1840 #define __itt_id_destroy_ptr 0
1841 #endif /* INTEL_NO_ITTNOTIFY_API */
1842 #else  /* INTEL_NO_MACRO_BODY */
1843 #define __itt_id_destroy_ptr 0
1844 #endif /* INTEL_NO_MACRO_BODY */
1845 /** @endcond */
1846 /** @} ids group */
1847 
1848 /**
1849  * @defgroup handless String Handles
1850  * @ingroup public
1851  * String Handles group
1852  * @{
1853  */
1854 
1855 /** @cond exclude_from_documentation */
1856 #pragma pack(push, 8)
1857 
1858 typedef struct ___itt_string_handle
1859 {
1860     const char* strA; /*!< Copy of original string in ASCII. */
1861 #if defined(UNICODE) || defined(_UNICODE)
1862     const wchar_t* strW; /*!< Copy of original string in UNICODE. */
1863 #else  /* UNICODE || _UNICODE */
1864     void* strW;
1865 #endif /* UNICODE || _UNICODE */
1866     int   extra1; /*!< Reserved. Must be zero   */
1867     void* extra2; /*!< Reserved. Must be zero   */
1868     struct ___itt_string_handle* next;
1869 } __itt_string_handle;
1870 
1871 #pragma pack(pop)
1872 /** @endcond */
1873 
1874 /**
1875  * @ingroup handles
1876  * @brief Create a string handle.
1877  * Create and return handle value that can be associated with a string.
1878  * Consecutive calls to __itt_string_handle_create with the same name
1879  * return the same value. Because the set of string handles is expected to remain
1880  * static during the application's execution time, there is no mechanism to destroy a string handle.
1881  * Any string handle can be accessed by any thread in the process, regardless of which thread created
1882  * the string handle. This call is thread-safe.
1883  * @param[in] name The input string
1884  */
1885 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1886 __itt_string_handle* ITTAPI __itt_string_handle_createA(const char    *name);
1887 __itt_string_handle* ITTAPI __itt_string_handle_createW(const wchar_t *name);
1888 #if defined(UNICODE) || defined(_UNICODE)
1889 #  define __itt_string_handle_create     __itt_string_handle_createW
1890 #  define __itt_string_handle_create_ptr __itt_string_handle_createW_ptr
1891 #else /* UNICODE */
1892 #  define __itt_string_handle_create     __itt_string_handle_createA
1893 #  define __itt_string_handle_create_ptr __itt_string_handle_createA_ptr
1894 #endif /* UNICODE */
1895 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1896 __itt_string_handle* ITTAPI __itt_string_handle_create(const char *name);
1897 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1898 
1899 /** @cond exclude_from_documentation */
1900 #ifndef INTEL_NO_MACRO_BODY
1901 #ifndef INTEL_NO_ITTNOTIFY_API
1902 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1903 ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char    *name))
1904 ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name))
1905 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1906 ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_create,  (const char    *name))
1907 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1908 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1909 #define __itt_string_handle_createA     ITTNOTIFY_DATA(string_handle_createA)
1910 #define __itt_string_handle_createA_ptr ITTNOTIFY_NAME(string_handle_createA)
1911 #define __itt_string_handle_createW     ITTNOTIFY_DATA(string_handle_createW)
1912 #define __itt_string_handle_createW_ptr ITTNOTIFY_NAME(string_handle_createW)
1913 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1914 #define __itt_string_handle_create     ITTNOTIFY_DATA(string_handle_create)
1915 #define __itt_string_handle_create_ptr ITTNOTIFY_NAME(string_handle_create)
1916 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1917 #else  /* INTEL_NO_ITTNOTIFY_API */
1918 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1919 #define __itt_string_handle_createA(name) (__itt_string_handle*)0
1920 #define __itt_string_handle_createA_ptr 0
1921 #define __itt_string_handle_createW(name) (__itt_string_handle*)0
1922 #define __itt_string_handle_createW_ptr 0
1923 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1924 #define __itt_string_handle_create(name)  (__itt_string_handle*)0
1925 #define __itt_string_handle_create_ptr 0
1926 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1927 #endif /* INTEL_NO_ITTNOTIFY_API */
1928 #else  /* INTEL_NO_MACRO_BODY */
1929 #if ITT_PLATFORM==ITT_PLATFORM_WIN
1930 #define __itt_string_handle_createA_ptr 0
1931 #define __itt_string_handle_createW_ptr 0
1932 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1933 #define __itt_string_handle_create_ptr  0
1934 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
1935 #endif /* INTEL_NO_MACRO_BODY */
1936 /** @endcond */
1937 /** @} handles group */
1938 
1939 /** @cond exclude_from_documentation */
1940 typedef unsigned long long __itt_timestamp;
1941 /** @endcond */
1942 
1943 #define __itt_timestamp_none ((__itt_timestamp)-1LL)
1944 
1945 /** @cond exclude_from_gpa_documentation */
1946 
1947 /**
1948  * @ingroup timestamps
1949  * @brief Return timestamp corresponding to the current moment.
1950  * This returns the timestamp in the format that is the most relevant for the current
1951  * host or platform (RDTSC, QPC, and others). You can use the "<" operator to
1952  * compare __itt_timestamp values.
1953  */
1954 __itt_timestamp ITTAPI __itt_get_timestamp(void);
1955 
1956 /** @cond exclude_from_documentation */
1957 #ifndef INTEL_NO_MACRO_BODY
1958 #ifndef INTEL_NO_ITTNOTIFY_API
1959 ITT_STUB(ITTAPI, __itt_timestamp, get_timestamp, (void))
1960 #define __itt_get_timestamp      ITTNOTIFY_DATA(get_timestamp)
1961 #define __itt_get_timestamp_ptr  ITTNOTIFY_NAME(get_timestamp)
1962 #else  /* INTEL_NO_ITTNOTIFY_API */
1963 #define __itt_get_timestamp()
1964 #define __itt_get_timestamp_ptr 0
1965 #endif /* INTEL_NO_ITTNOTIFY_API */
1966 #else  /* INTEL_NO_MACRO_BODY */
1967 #define __itt_get_timestamp_ptr 0
1968 #endif /* INTEL_NO_MACRO_BODY */
1969 /** @endcond */
1970 /** @} timestamps */
1971 /** @endcond */
1972 
1973 /** @cond exclude_from_gpa_documentation */
1974 
1975 /**
1976  * @defgroup regions Regions
1977  * @ingroup public
1978  * Regions group
1979  * @{
1980  */
1981 /**
1982  * @ingroup regions
1983  * @brief Begin of region instance.
1984  * Successive calls to __itt_region_begin with the same ID are ignored
1985  * until a call to __itt_region_end with the same ID
1986  * @param[in] domain The domain for this region instance
1987  * @param[in] id The instance ID for this region instance. Must not be __itt_null
1988  * @param[in] parentid The instance ID for the parent of this region instance, or __itt_null
1989  * @param[in] name The name of this region
1990  */
1991 void ITTAPI __itt_region_begin(const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name);
1992 
1993 /**
1994  * @ingroup regions
1995  * @brief End of region instance.
1996  * The first call to __itt_region_end with a given ID ends the
1997  * region. Successive calls with the same ID are ignored, as are
1998  * calls that do not have a matching __itt_region_begin call.
1999  * @param[in] domain The domain for this region instance
2000  * @param[in] id The instance ID for this region instance
2001  */
2002 void ITTAPI __itt_region_end(const __itt_domain *domain, __itt_id id);
2003 
2004 /** @cond exclude_from_documentation */
2005 #ifndef INTEL_NO_MACRO_BODY
2006 #ifndef INTEL_NO_ITTNOTIFY_API
2007 ITT_STUBV(ITTAPI, void, region_begin, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name))
2008 ITT_STUBV(ITTAPI, void, region_end,   (const __itt_domain *domain, __itt_id id))
2009 #define __itt_region_begin(d,x,y,z) ITTNOTIFY_VOID_D3(region_begin,d,x,y,z)
2010 #define __itt_region_begin_ptr      ITTNOTIFY_NAME(region_begin)
2011 #define __itt_region_end(d,x)       ITTNOTIFY_VOID_D1(region_end,d,x)
2012 #define __itt_region_end_ptr        ITTNOTIFY_NAME(region_end)
2013 #else  /* INTEL_NO_ITTNOTIFY_API */
2014 #define __itt_region_begin(d,x,y,z)
2015 #define __itt_region_begin_ptr 0
2016 #define __itt_region_end(d,x)
2017 #define __itt_region_end_ptr   0
2018 #endif /* INTEL_NO_ITTNOTIFY_API */
2019 #else  /* INTEL_NO_MACRO_BODY */
2020 #define __itt_region_begin_ptr 0
2021 #define __itt_region_end_ptr   0
2022 #endif /* INTEL_NO_MACRO_BODY */
2023 /** @endcond */
2024 /** @} regions group */
2025 
2026 /**
2027  * @defgroup frames Frames
2028  * @ingroup public
2029  * Frames are similar to regions, but are intended to be easier to use and to implement.
2030  * In particular:
2031  * - Frames always represent periods of elapsed time
2032  * - By default, frames have no nesting relationships
2033  * @{
2034  */
2035 
2036 /**
2037  * @ingroup frames
2038  * @brief Begin a frame instance.
2039  * Successive calls to __itt_frame_begin with the
2040  * same ID are ignored until a call to __itt_frame_end with the same ID.
2041  * @param[in] domain The domain for this frame instance
2042  * @param[in] id The instance ID for this frame instance or NULL
2043  */
2044 void ITTAPI __itt_frame_begin_v3(const __itt_domain *domain, __itt_id *id);
2045 
2046 /**
2047  * @ingroup frames
2048  * @brief End a frame instance.
2049  * The first call to __itt_frame_end with a given ID
2050  * ends the frame. Successive calls with the same ID are ignored, as are
2051  * calls that do not have a matching __itt_frame_begin call.
2052  * @param[in] domain The domain for this frame instance
2053  * @param[in] id The instance ID for this frame instance or NULL for current
2054  */
2055 void ITTAPI __itt_frame_end_v3(const __itt_domain *domain, __itt_id *id);
2056 
2057 /**
2058  * @ingroup frames
2059  * @brief Submits a frame instance.
2060  * Successive calls to __itt_frame_begin or __itt_frame_submit with the
2061  * same ID are ignored until a call to __itt_frame_end or __itt_frame_submit
2062  * with the same ID.
2063  * Passing special __itt_timestamp_none value as "end" argument means
2064  * take the current timestamp as the end timestamp.
2065  * @param[in] domain The domain for this frame instance
2066  * @param[in] id The instance ID for this frame instance or NULL
2067  * @param[in] begin Timestamp of the beginning of the frame
2068  * @param[in] end Timestamp of the end of the frame
2069  */
2070 void ITTAPI __itt_frame_submit_v3(const __itt_domain *domain, __itt_id *id,
2071     __itt_timestamp begin, __itt_timestamp end);
2072 
2073 /** @cond exclude_from_documentation */
2074 #ifndef INTEL_NO_MACRO_BODY
2075 #ifndef INTEL_NO_ITTNOTIFY_API
2076 ITT_STUBV(ITTAPI, void, frame_begin_v3,  (const __itt_domain *domain, __itt_id *id))
2077 ITT_STUBV(ITTAPI, void, frame_end_v3,    (const __itt_domain *domain, __itt_id *id))
2078 ITT_STUBV(ITTAPI, void, frame_submit_v3, (const __itt_domain *domain, __itt_id *id, __itt_timestamp begin, __itt_timestamp end))
2079 #define __itt_frame_begin_v3(d,x)      ITTNOTIFY_VOID_D1(frame_begin_v3,d,x)
2080 #define __itt_frame_begin_v3_ptr       ITTNOTIFY_NAME(frame_begin_v3)
2081 #define __itt_frame_end_v3(d,x)        ITTNOTIFY_VOID_D1(frame_end_v3,d,x)
2082 #define __itt_frame_end_v3_ptr         ITTNOTIFY_NAME(frame_end_v3)
2083 #define __itt_frame_submit_v3(d,x,b,e) ITTNOTIFY_VOID_D3(frame_submit_v3,d,x,b,e)
2084 #define __itt_frame_submit_v3_ptr      ITTNOTIFY_NAME(frame_submit_v3)
2085 #else  /* INTEL_NO_ITTNOTIFY_API */
2086 #define __itt_frame_begin_v3(domain,id)
2087 #define __itt_frame_begin_v3_ptr 0
2088 #define __itt_frame_end_v3(domain,id)
2089 #define __itt_frame_end_v3_ptr   0
2090 #define __itt_frame_submit_v3(domain,id,begin,end)
2091 #define __itt_frame_submit_v3_ptr   0
2092 #endif /* INTEL_NO_ITTNOTIFY_API */
2093 #else  /* INTEL_NO_MACRO_BODY */
2094 #define __itt_frame_begin_v3_ptr 0
2095 #define __itt_frame_end_v3_ptr   0
2096 #define __itt_frame_submit_v3_ptr   0
2097 #endif /* INTEL_NO_MACRO_BODY */
2098 /** @endcond */
2099 /** @} frames group */
2100 /** @endcond */
2101 
2102 /**
2103  * @defgroup taskgroup Task Group
2104  * @ingroup public
2105  * Task Group
2106  * @{
2107  */
2108 /**
2109  * @ingroup task_groups
2110  * @brief Denotes a task_group instance.
2111  * Successive calls to __itt_task_group with the same ID are ignored.
2112  * @param[in] domain The domain for this task_group instance
2113  * @param[in] id The instance ID for this task_group instance. Must not be __itt_null.
2114  * @param[in] parentid The instance ID for the parent of this task_group instance, or __itt_null.
2115  * @param[in] name The name of this task_group
2116  */
2117 void ITTAPI __itt_task_group(const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name);
2118 
2119 /** @cond exclude_from_documentation */
2120 #ifndef INTEL_NO_MACRO_BODY
2121 #ifndef INTEL_NO_ITTNOTIFY_API
2122 ITT_STUBV(ITTAPI, void, task_group, (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name))
2123 #define __itt_task_group(d,x,y,z) ITTNOTIFY_VOID_D3(task_group,d,x,y,z)
2124 #define __itt_task_group_ptr      ITTNOTIFY_NAME(task_group)
2125 #else  /* INTEL_NO_ITTNOTIFY_API */
2126 #define __itt_task_group(d,x,y,z)
2127 #define __itt_task_group_ptr 0
2128 #endif /* INTEL_NO_ITTNOTIFY_API */
2129 #else  /* INTEL_NO_MACRO_BODY */
2130 #define __itt_task_group_ptr 0
2131 #endif /* INTEL_NO_MACRO_BODY */
2132 /** @endcond */
2133 /** @} taskgroup group */
2134 
2135 /**
2136  * @defgroup tasks Tasks
2137  * @ingroup public
2138  * A task instance represents a piece of work performed by a particular
2139  * thread for a period of time. A call to __itt_task_begin creates a
2140  * task instance. This becomes the current instance for that task on that
2141  * thread. A following call to __itt_task_end on the same thread ends the
2142  * instance. There may be multiple simultaneous instances of tasks with the
2143  * same name on different threads. If an ID is specified, the task instance
2144  * receives that ID. Nested tasks are allowed.
2145  *
2146  * Note: The task is defined by the bracketing of __itt_task_begin and
2147  * __itt_task_end on the same thread. If some scheduling mechanism causes
2148  * task switching (the thread executes a different user task) or task
2149  * switching (the user task switches to a different thread) then this breaks
2150  * the notion of  current instance. Additional API calls are required to
2151  * deal with that possibility.
2152  * @{
2153  */
2154 
2155 /**
2156  * @ingroup tasks
2157  * @brief Begin a task instance.
2158  * @param[in] domain The domain for this task
2159  * @param[in] taskid The instance ID for this task instance, or __itt_null
2160  * @param[in] parentid The parent instance to which this task instance belongs, or __itt_null
2161  * @param[in] name The name of this task
2162  */
2163 void ITTAPI __itt_task_begin(const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name);
2164 
2165 /**
2166  * @ingroup tasks
2167  * @brief Begin a task instance.
2168  * @param[in] domain The domain for this task
2169  * @param[in] taskid The identifier for this task instance (may be 0)
2170  * @param[in] parentid The parent of this task (may be 0)
2171  * @param[in] fn The pointer to the function you are tracing
2172  */
2173 void ITTAPI __itt_task_begin_fn(const __itt_domain *domain, __itt_id taskid, __itt_id parentid, void* fn);
2174 
2175 /**
2176  * @ingroup tasks
2177  * @brief End the current task instance.
2178  * @param[in] domain The domain for this task
2179  */
2180 void ITTAPI __itt_task_end(const __itt_domain *domain);
2181 
2182 /**
2183  * @ingroup tasks
2184  * @brief Begin an overlapped task instance.
2185  * @param[in] domain The domain for this task.
2186  * @param[in] taskid The identifier for this task instance, *cannot* be __itt_null.
2187  * @param[in] parentid The parent of this task, or __itt_null.
2188  * @param[in] name The name of this task.
2189  */
2190 void ITTAPI __itt_task_begin_overlapped(const __itt_domain* domain, __itt_id taskid, __itt_id parentid, __itt_string_handle* name);
2191 
2192 /**
2193  * @ingroup tasks
2194  * @brief End an overlapped task instance.
2195  * @param[in] domain The domain for this task
2196  * @param[in] taskid Explicit ID of finished task
2197  */
2198 void ITTAPI __itt_task_end_overlapped(const __itt_domain *domain, __itt_id taskid);
2199 
2200 /** @cond exclude_from_documentation */
2201 #ifndef INTEL_NO_MACRO_BODY
2202 #ifndef INTEL_NO_ITTNOTIFY_API
2203 ITT_STUBV(ITTAPI, void, task_begin,    (const __itt_domain *domain, __itt_id id, __itt_id parentid, __itt_string_handle *name))
2204 ITT_STUBV(ITTAPI, void, task_begin_fn, (const __itt_domain *domain, __itt_id id, __itt_id parentid, void* fn))
2205 ITT_STUBV(ITTAPI, void, task_end,      (const __itt_domain *domain))
2206 ITT_STUBV(ITTAPI, void, task_begin_overlapped, (const __itt_domain *domain, __itt_id taskid, __itt_id parentid, __itt_string_handle *name))
2207 ITT_STUBV(ITTAPI, void, task_end_overlapped,   (const __itt_domain *domain, __itt_id taskid))
2208 #define __itt_task_begin(d,x,y,z)    ITTNOTIFY_VOID_D3(task_begin,d,x,y,z)
2209 #define __itt_task_begin_ptr         ITTNOTIFY_NAME(task_begin)
2210 #define __itt_task_begin_fn(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin_fn,d,x,y,z)
2211 #define __itt_task_begin_fn_ptr      ITTNOTIFY_NAME(task_begin_fn)
2212 #define __itt_task_end(d)            ITTNOTIFY_VOID_D0(task_end,d)
2213 #define __itt_task_end_ptr           ITTNOTIFY_NAME(task_end)
2214 #define __itt_task_begin_overlapped(d,x,y,z) ITTNOTIFY_VOID_D3(task_begin_overlapped,d,x,y,z)
2215 #define __itt_task_begin_overlapped_ptr      ITTNOTIFY_NAME(task_begin_overlapped)
2216 #define __itt_task_end_overlapped(d,x)       ITTNOTIFY_VOID_D1(task_end_overlapped,d,x)
2217 #define __itt_task_end_overlapped_ptr        ITTNOTIFY_NAME(task_end_overlapped)
2218 #else  /* INTEL_NO_ITTNOTIFY_API */
2219 #define __itt_task_begin(domain,id,parentid,name)
2220 #define __itt_task_begin_ptr    0
2221 #define __itt_task_begin_fn(domain,id,parentid,fn)
2222 #define __itt_task_begin_fn_ptr 0
2223 #define __itt_task_end(domain)
2224 #define __itt_task_end_ptr      0
2225 #define __itt_task_begin_overlapped(domain,taskid,parentid,name)
2226 #define __itt_task_begin_overlapped_ptr         0
2227 #define __itt_task_end_overlapped(domain,taskid)
2228 #define __itt_task_end_overlapped_ptr           0
2229 #endif /* INTEL_NO_ITTNOTIFY_API */
2230 #else  /* INTEL_NO_MACRO_BODY */
2231 #define __itt_task_begin_ptr    0
2232 #define __itt_task_begin_fn_ptr 0
2233 #define __itt_task_end_ptr      0
2234 #define __itt_task_begin_overlapped_ptr 0
2235 #define __itt_task_end_overlapped_ptr   0
2236 #endif /* INTEL_NO_MACRO_BODY */
2237 /** @endcond */
2238 /** @} tasks group */
2239 
2240 
2241 /**
2242  * @defgroup markers Markers
2243  * Markers represent a single discreet event in time. Markers have a scope,
2244  * described by an enumerated type __itt_scope. Markers are created by
2245  * the API call __itt_marker. A marker instance can be given an ID for use in
2246  * adding metadata.
2247  * @{
2248  */
2249 
2250 /**
2251  * @brief Describes the scope of an event object in the trace.
2252  */
2253 typedef enum
2254 {
2255     __itt_scope_unknown = 0,
2256     __itt_scope_global,
2257     __itt_scope_track_group,
2258     __itt_scope_track,
2259     __itt_scope_task,
2260     __itt_scope_marker
2261 } __itt_scope;
2262 
2263 /** @cond exclude_from_documentation */
2264 #define __itt_marker_scope_unknown  __itt_scope_unknown
2265 #define __itt_marker_scope_global   __itt_scope_global
2266 #define __itt_marker_scope_process  __itt_scope_track_group
2267 #define __itt_marker_scope_thread   __itt_scope_track
2268 #define __itt_marker_scope_task     __itt_scope_task
2269 /** @endcond */
2270 
2271 /**
2272  * @ingroup markers
2273  * @brief Create a marker instance
2274  * @param[in] domain The domain for this marker
2275  * @param[in] id The instance ID for this marker or __itt_null
2276  * @param[in] name The name for this marker
2277  * @param[in] scope The scope for this marker
2278  */
2279 void ITTAPI __itt_marker(const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope);
2280 
2281 /** @cond exclude_from_documentation */
2282 #ifndef INTEL_NO_MACRO_BODY
2283 #ifndef INTEL_NO_ITTNOTIFY_API
2284 ITT_STUBV(ITTAPI, void, marker, (const __itt_domain *domain, __itt_id id, __itt_string_handle *name, __itt_scope scope))
2285 #define __itt_marker(d,x,y,z) ITTNOTIFY_VOID_D3(marker,d,x,y,z)
2286 #define __itt_marker_ptr      ITTNOTIFY_NAME(marker)
2287 #else  /* INTEL_NO_ITTNOTIFY_API */
2288 #define __itt_marker(domain,id,name,scope)
2289 #define __itt_marker_ptr 0
2290 #endif /* INTEL_NO_ITTNOTIFY_API */
2291 #else  /* INTEL_NO_MACRO_BODY */
2292 #define __itt_marker_ptr 0
2293 #endif /* INTEL_NO_MACRO_BODY */
2294 /** @endcond */
2295 /** @} markers group */
2296 
2297 /**
2298  * @defgroup metadata Metadata
2299  * The metadata API is used to attach extra information to named
2300  * entities. Metadata can be attached to an identified named entity by ID,
2301  * or to the current entity (which is always a task).
2302  *
2303  * Conceptually metadata has a type (what kind of metadata), a key (the
2304  * name of the metadata), and a value (the actual data). The encoding of
2305  * the value depends on the type of the metadata.
2306  *
2307  * The type of metadata is specified by an enumerated type __itt_metdata_type.
2308  * @{
2309  */
2310 
2311 /**
2312  * @ingroup parameters
2313  * @brief describes the type of metadata
2314  */
2315 typedef enum {
2316     __itt_metadata_unknown = 0,
2317     __itt_metadata_u64,     /**< Unsigned 64-bit integer */
2318     __itt_metadata_s64,     /**< Signed 64-bit integer */
2319     __itt_metadata_u32,     /**< Unsigned 32-bit integer */
2320     __itt_metadata_s32,     /**< Signed 32-bit integer */
2321     __itt_metadata_u16,     /**< Unsigned 16-bit integer */
2322     __itt_metadata_s16,     /**< Signed 16-bit integer */
2323     __itt_metadata_float,   /**< Signed 32-bit floating-point */
2324     __itt_metadata_double   /**< SIgned 64-bit floating-point */
2325 } __itt_metadata_type;
2326 
2327 /**
2328  * @ingroup parameters
2329  * @brief Add metadata to an instance of a named entity.
2330  * @param[in] domain The domain controlling the call
2331  * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
2332  * @param[in] key The name of the metadata
2333  * @param[in] type The type of the metadata
2334  * @param[in] count The number of elements of the given type. If count == 0, no metadata will be added.
2335  * @param[in] data The metadata itself
2336 */
2337 void ITTAPI __itt_metadata_add(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data);
2338 
2339 /** @cond exclude_from_documentation */
2340 #ifndef INTEL_NO_MACRO_BODY
2341 #ifndef INTEL_NO_ITTNOTIFY_API
2342 ITT_STUBV(ITTAPI, void, metadata_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data))
2343 #define __itt_metadata_add(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(metadata_add,d,x,y,z,a,b)
2344 #define __itt_metadata_add_ptr          ITTNOTIFY_NAME(metadata_add)
2345 #else  /* INTEL_NO_ITTNOTIFY_API */
2346 #define __itt_metadata_add(d,x,y,z,a,b)
2347 #define __itt_metadata_add_ptr 0
2348 #endif /* INTEL_NO_ITTNOTIFY_API */
2349 #else  /* INTEL_NO_MACRO_BODY */
2350 #define __itt_metadata_add_ptr 0
2351 #endif /* INTEL_NO_MACRO_BODY */
2352 /** @endcond */
2353 
2354 /**
2355  * @ingroup parameters
2356  * @brief Add string metadata to an instance of a named entity.
2357  * @param[in] domain The domain controlling the call
2358  * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
2359  * @param[in] key The name of the metadata
2360  * @param[in] data The metadata itself
2361  * @param[in] length The number of characters in the string, or -1 if the length is unknown but the string is null-terminated
2362 */
2363 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2364 void ITTAPI __itt_metadata_str_addA(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length);
2365 void ITTAPI __itt_metadata_str_addW(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t *data, size_t length);
2366 #if defined(UNICODE) || defined(_UNICODE)
2367 #  define __itt_metadata_str_add     __itt_metadata_str_addW
2368 #  define __itt_metadata_str_add_ptr __itt_metadata_str_addW_ptr
2369 #else /* UNICODE */
2370 #  define __itt_metadata_str_add     __itt_metadata_str_addA
2371 #  define __itt_metadata_str_add_ptr __itt_metadata_str_addA_ptr
2372 #endif /* UNICODE */
2373 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2374 void ITTAPI __itt_metadata_str_add(const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length);
2375 #endif
2376 
2377 /** @cond exclude_from_documentation */
2378 #ifndef INTEL_NO_MACRO_BODY
2379 #ifndef INTEL_NO_ITTNOTIFY_API
2380 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2381 ITT_STUBV(ITTAPI, void, metadata_str_addA, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length))
2382 ITT_STUBV(ITTAPI, void, metadata_str_addW, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const wchar_t *data, size_t length))
2383 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2384 ITT_STUBV(ITTAPI, void, metadata_str_add, (const __itt_domain *domain, __itt_id id, __itt_string_handle *key, const char *data, size_t length))
2385 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2386 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2387 #define __itt_metadata_str_addA(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_addA,d,x,y,z,a)
2388 #define __itt_metadata_str_addA_ptr        ITTNOTIFY_NAME(metadata_str_addA)
2389 #define __itt_metadata_str_addW(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_addW,d,x,y,z,a)
2390 #define __itt_metadata_str_addW_ptr        ITTNOTIFY_NAME(metadata_str_addW)
2391 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2392 #define __itt_metadata_str_add(d,x,y,z,a)  ITTNOTIFY_VOID_D4(metadata_str_add,d,x,y,z,a)
2393 #define __itt_metadata_str_add_ptr         ITTNOTIFY_NAME(metadata_str_add)
2394 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2395 #else  /* INTEL_NO_ITTNOTIFY_API */
2396 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2397 #define __itt_metadata_str_addA(d,x,y,z,a)
2398 #define __itt_metadata_str_addA_ptr 0
2399 #define __itt_metadata_str_addW(d,x,y,z,a)
2400 #define __itt_metadata_str_addW_ptr 0
2401 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2402 #define __itt_metadata_str_add(d,x,y,z,a)
2403 #define __itt_metadata_str_add_ptr 0
2404 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2405 #endif /* INTEL_NO_ITTNOTIFY_API */
2406 #else  /* INTEL_NO_MACRO_BODY */
2407 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2408 #define __itt_metadata_str_addA_ptr 0
2409 #define __itt_metadata_str_addW_ptr 0
2410 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2411 #define __itt_metadata_str_add_ptr  0
2412 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2413 #endif /* INTEL_NO_MACRO_BODY */
2414 /** @endcond */
2415 
2416 /**
2417  * @ingroup parameters
2418  * @brief Add metadata to an instance of a named entity.
2419  * @param[in] domain The domain controlling the call
2420  * @param[in] scope The scope of the instance to which the metadata is to be added
2421 
2422  * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
2423 
2424  * @param[in] key The name of the metadata
2425  * @param[in] type The type of the metadata
2426  * @param[in] count The number of elements of the given type. If count == 0, no metadata will be added.
2427  * @param[in] data The metadata itself
2428 */
2429 void ITTAPI __itt_metadata_add_with_scope(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data);
2430 
2431 /** @cond exclude_from_documentation */
2432 #ifndef INTEL_NO_MACRO_BODY
2433 #ifndef INTEL_NO_ITTNOTIFY_API
2434 ITT_STUBV(ITTAPI, void, metadata_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, __itt_metadata_type type, size_t count, void *data))
2435 #define __itt_metadata_add_with_scope(d,x,y,z,a,b) ITTNOTIFY_VOID_D5(metadata_add_with_scope,d,x,y,z,a,b)
2436 #define __itt_metadata_add_with_scope_ptr          ITTNOTIFY_NAME(metadata_add_with_scope)
2437 #else  /* INTEL_NO_ITTNOTIFY_API */
2438 #define __itt_metadata_add_with_scope(d,x,y,z,a,b)
2439 #define __itt_metadata_add_with_scope_ptr 0
2440 #endif /* INTEL_NO_ITTNOTIFY_API */
2441 #else  /* INTEL_NO_MACRO_BODY */
2442 #define __itt_metadata_add_with_scope_ptr 0
2443 #endif /* INTEL_NO_MACRO_BODY */
2444 /** @endcond */
2445 
2446 /**
2447  * @ingroup parameters
2448  * @brief Add string metadata to an instance of a named entity.
2449  * @param[in] domain The domain controlling the call
2450  * @param[in] scope The scope of the instance to which the metadata is to be added
2451 
2452  * @param[in] id The identifier of the instance to which the metadata is to be added, or __itt_null to add to the current task
2453 
2454  * @param[in] key The name of the metadata
2455  * @param[in] data The metadata itself
2456  * @param[in] length The number of characters in the string, or -1 if the length is unknown but the string is null-terminated
2457 */
2458 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2459 void ITTAPI __itt_metadata_str_add_with_scopeA(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length);
2460 void ITTAPI __itt_metadata_str_add_with_scopeW(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length);
2461 #if defined(UNICODE) || defined(_UNICODE)
2462 #  define __itt_metadata_str_add_with_scope     __itt_metadata_str_add_with_scopeW
2463 #  define __itt_metadata_str_add_with_scope_ptr __itt_metadata_str_add_with_scopeW_ptr
2464 #else /* UNICODE */
2465 #  define __itt_metadata_str_add_with_scope     __itt_metadata_str_add_with_scopeA
2466 #  define __itt_metadata_str_add_with_scope_ptr __itt_metadata_str_add_with_scopeA_ptr
2467 #endif /* UNICODE */
2468 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2469 void ITTAPI __itt_metadata_str_add_with_scope(const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length);
2470 #endif
2471 
2472 /** @cond exclude_from_documentation */
2473 #ifndef INTEL_NO_MACRO_BODY
2474 #ifndef INTEL_NO_ITTNOTIFY_API
2475 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2476 ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeA, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length))
2477 ITT_STUBV(ITTAPI, void, metadata_str_add_with_scopeW, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const wchar_t *data, size_t length))
2478 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2479 ITT_STUBV(ITTAPI, void, metadata_str_add_with_scope, (const __itt_domain *domain, __itt_scope scope, __itt_string_handle *key, const char *data, size_t length))
2480 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2481 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2482 #define __itt_metadata_str_add_with_scopeA(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeA,d,x,y,z,a)
2483 #define __itt_metadata_str_add_with_scopeA_ptr        ITTNOTIFY_NAME(metadata_str_add_with_scopeA)
2484 #define __itt_metadata_str_add_with_scopeW(d,x,y,z,a) ITTNOTIFY_VOID_D4(metadata_str_add_with_scopeW,d,x,y,z,a)
2485 #define __itt_metadata_str_add_with_scopeW_ptr        ITTNOTIFY_NAME(metadata_str_add_with_scopeW)
2486 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2487 #define __itt_metadata_str_add_with_scope(d,x,y,z,a)  ITTNOTIFY_VOID_D4(metadata_str_add_with_scope,d,x,y,z,a)
2488 #define __itt_metadata_str_add_with_scope_ptr         ITTNOTIFY_NAME(metadata_str_add_with_scope)
2489 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2490 #else  /* INTEL_NO_ITTNOTIFY_API */
2491 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2492 #define __itt_metadata_str_add_with_scopeA(d,x,y,z,a)
2493 #define __itt_metadata_str_add_with_scopeA_ptr  0
2494 #define __itt_metadata_str_add_with_scopeW(d,x,y,z,a)
2495 #define __itt_metadata_str_add_with_scopeW_ptr  0
2496 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2497 #define __itt_metadata_str_add_with_scope(d,x,y,z,a)
2498 #define __itt_metadata_str_add_with_scope_ptr   0
2499 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2500 #endif /* INTEL_NO_ITTNOTIFY_API */
2501 #else  /* INTEL_NO_MACRO_BODY */
2502 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2503 #define __itt_metadata_str_add_with_scopeA_ptr  0
2504 #define __itt_metadata_str_add_with_scopeW_ptr  0
2505 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2506 #define __itt_metadata_str_add_with_scope_ptr   0
2507 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2508 #endif /* INTEL_NO_MACRO_BODY */
2509 /** @endcond */
2510 
2511 /** @} metadata group */
2512 
2513 /**
2514  * @defgroup relations Relations
2515  * Instances of named entities can be explicitly associated with other
2516  * instances using instance IDs and the relationship API calls.
2517  *
2518  * @{
2519  */
2520 
2521 /**
2522  * @ingroup relations
2523  * @brief The kind of relation between two instances is specified by the enumerated type __itt_relation.
2524  * Relations between instances can be added with an API call. The relation
2525  * API uses instance IDs. Relations can be added before or after the actual
2526  * instances are created and persist independently of the instances. This
2527  * is the motivation for having different lifetimes for instance IDs and
2528  * the actual instances.
2529  */
2530 typedef enum
2531 {
2532     __itt_relation_is_unknown = 0,
2533     __itt_relation_is_dependent_on,         /**< "A is dependent on B" means that A cannot start until B completes */
2534     __itt_relation_is_sibling_of,           /**< "A is sibling of B" means that A and B were created as a group */
2535     __itt_relation_is_parent_of,            /**< "A is parent of B" means that A created B */
2536     __itt_relation_is_continuation_of,      /**< "A is continuation of B" means that A assumes the dependencies of B */
2537     __itt_relation_is_child_of,             /**< "A is child of B" means that A was created by B (inverse of is_parent_of) */
2538     __itt_relation_is_continued_by,         /**< "A is continued by B" means that B assumes the dependencies of A (inverse of is_continuation_of) */
2539     __itt_relation_is_predecessor_to        /**< "A is predecessor to B" means that B cannot start until A completes (inverse of is_dependent_on) */
2540 } __itt_relation;
2541 
2542 /**
2543  * @ingroup relations
2544  * @brief Add a relation to the current task instance.
2545  * The current task instance is the head of the relation.
2546  * @param[in] domain The domain controlling this call
2547  * @param[in] relation The kind of relation
2548  * @param[in] tail The ID for the tail of the relation
2549  */
2550 void ITTAPI __itt_relation_add_to_current(const __itt_domain *domain, __itt_relation relation, __itt_id tail);
2551 
2552 /**
2553  * @ingroup relations
2554  * @brief Add a relation between two instance identifiers.
2555  * @param[in] domain The domain controlling this call
2556  * @param[in] head The ID for the head of the relation
2557  * @param[in] relation The kind of relation
2558  * @param[in] tail The ID for the tail of the relation
2559  */
2560 void ITTAPI __itt_relation_add(const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail);
2561 
2562 /** @cond exclude_from_documentation */
2563 #ifndef INTEL_NO_MACRO_BODY
2564 #ifndef INTEL_NO_ITTNOTIFY_API
2565 ITT_STUBV(ITTAPI, void, relation_add_to_current, (const __itt_domain *domain, __itt_relation relation, __itt_id tail))
2566 ITT_STUBV(ITTAPI, void, relation_add,            (const __itt_domain *domain, __itt_id head, __itt_relation relation, __itt_id tail))
2567 #define __itt_relation_add_to_current(d,x,y) ITTNOTIFY_VOID_D2(relation_add_to_current,d,x,y)
2568 #define __itt_relation_add_to_current_ptr    ITTNOTIFY_NAME(relation_add_to_current)
2569 #define __itt_relation_add(d,x,y,z)          ITTNOTIFY_VOID_D3(relation_add,d,x,y,z)
2570 #define __itt_relation_add_ptr               ITTNOTIFY_NAME(relation_add)
2571 #else  /* INTEL_NO_ITTNOTIFY_API */
2572 #define __itt_relation_add_to_current(d,x,y)
2573 #define __itt_relation_add_to_current_ptr 0
2574 #define __itt_relation_add(d,x,y,z)
2575 #define __itt_relation_add_ptr 0
2576 #endif /* INTEL_NO_ITTNOTIFY_API */
2577 #else  /* INTEL_NO_MACRO_BODY */
2578 #define __itt_relation_add_to_current_ptr 0
2579 #define __itt_relation_add_ptr 0
2580 #endif /* INTEL_NO_MACRO_BODY */
2581 /** @endcond */
2582 /** @} relations group */
2583 
2584 /** @cond exclude_from_documentation */
2585 #pragma pack(push, 8)
2586 
2587 typedef struct ___itt_clock_info
2588 {
2589     unsigned long long clock_freq; /*!< Clock domain frequency */
2590     unsigned long long clock_base; /*!< Clock domain base timestamp */
2591 } __itt_clock_info;
2592 
2593 #pragma pack(pop)
2594 /** @endcond */
2595 
2596 /** @cond exclude_from_documentation */
2597 typedef void (ITTAPI *__itt_get_clock_info_fn)(__itt_clock_info* clock_info, void* data);
2598 /** @endcond */
2599 
2600 /** @cond exclude_from_documentation */
2601 #pragma pack(push, 8)
2602 
2603 typedef struct ___itt_clock_domain
2604 {
2605     __itt_clock_info info;      /*!< Most recent clock domain info */
2606     __itt_get_clock_info_fn fn; /*!< Callback function pointer */
2607     void* fn_data;              /*!< Input argument for the callback function */
2608     int   extra1;               /*!< Reserved. Must be zero */
2609     void* extra2;               /*!< Reserved. Must be zero */
2610     struct ___itt_clock_domain* next;
2611 } __itt_clock_domain;
2612 
2613 #pragma pack(pop)
2614 /** @endcond */
2615 
2616 /**
2617  * @ingroup clockdomains
2618  * @brief Create a clock domain.
2619  * Certain applications require the capability to trace their application using
2620  * a clock domain different than the CPU, for instance the instrumentation of events
2621  * that occur on a GPU.
2622  * Because the set of domains is expected to be static over the application's execution time,
2623  * there is no mechanism to destroy a domain.
2624  * Any domain can be accessed by any thread in the process, regardless of which thread created
2625  * the domain. This call is thread-safe.
2626  * @param[in] fn A pointer to a callback function which retrieves alternative CPU timestamps
2627  * @param[in] fn_data Argument for a callback function; may be NULL
2628  */
2629 __itt_clock_domain* ITTAPI __itt_clock_domain_create(__itt_get_clock_info_fn fn, void* fn_data);
2630 
2631 /** @cond exclude_from_documentation */
2632 #ifndef INTEL_NO_MACRO_BODY
2633 #ifndef INTEL_NO_ITTNOTIFY_API
2634 ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info_fn fn, void* fn_data))
2635 #define __itt_clock_domain_create     ITTNOTIFY_DATA(clock_domain_create)
2636 #define __itt_clock_domain_create_ptr ITTNOTIFY_NAME(clock_domain_create)
2637 #else  /* INTEL_NO_ITTNOTIFY_API */
2638 #define __itt_clock_domain_create(fn,fn_data) (__itt_clock_domain*)0
2639 #define __itt_clock_domain_create_ptr 0
2640 #endif /* INTEL_NO_ITTNOTIFY_API */
2641 #else  /* INTEL_NO_MACRO_BODY */
2642 #define __itt_clock_domain_create_ptr 0
2643 #endif /* INTEL_NO_MACRO_BODY */
2644 /** @endcond */
2645 
2646 /**
2647  * @ingroup clockdomains
2648  * @brief Recalculate clock domains frequences and clock base timestamps.
2649  */
2650 void ITTAPI __itt_clock_domain_reset(void);
2651 
2652 /** @cond exclude_from_documentation */
2653 #ifndef INTEL_NO_MACRO_BODY
2654 #ifndef INTEL_NO_ITTNOTIFY_API
2655 ITT_STUBV(ITTAPI, void, clock_domain_reset, (void))
2656 #define __itt_clock_domain_reset     ITTNOTIFY_VOID(clock_domain_reset)
2657 #define __itt_clock_domain_reset_ptr ITTNOTIFY_NAME(clock_domain_reset)
2658 #else  /* INTEL_NO_ITTNOTIFY_API */
2659 #define __itt_clock_domain_reset()
2660 #define __itt_clock_domain_reset_ptr 0
2661 #endif /* INTEL_NO_ITTNOTIFY_API */
2662 #else  /* INTEL_NO_MACRO_BODY */
2663 #define __itt_clock_domain_reset_ptr 0
2664 #endif /* INTEL_NO_MACRO_BODY */
2665 /** @endcond */
2666 
2667 /**
2668  * @ingroup clockdomain
2669  * @brief Create an instance of identifier. This establishes the beginning of the lifetime of
2670  * an instance of the given ID in the trace. Once this lifetime starts, the ID can be used to
2671  * tag named entity instances in calls such as __itt_task_begin, and to specify relationships among
2672  * identified named entity instances, using the \ref relations APIs.
2673  * @param[in] domain The domain controlling the execution of this call.
2674  * @param[in] clock_domain The clock domain controlling the execution of this call.
2675  * @param[in] timestamp The user defined timestamp.
2676  * @param[in] id The ID to create.
2677  */
2678 void ITTAPI __itt_id_create_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id);
2679 
2680 /**
2681  * @ingroup clockdomain
2682  * @brief Destroy an instance of identifier. This ends the lifetime of the current instance of the
2683  * given ID value in the trace. Any relationships that are established after this lifetime ends are
2684  * invalid. This call must be performed before the given ID value can be reused for a different
2685  * named entity instance.
2686  * @param[in] domain The domain controlling the execution of this call.
2687  * @param[in] clock_domain The clock domain controlling the execution of this call.
2688  * @param[in] timestamp The user defined timestamp.
2689  * @param[in] id The ID to destroy.
2690  */
2691 void ITTAPI __itt_id_destroy_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id);
2692 
2693 /** @cond exclude_from_documentation */
2694 #ifndef INTEL_NO_MACRO_BODY
2695 #ifndef INTEL_NO_ITTNOTIFY_API
2696 ITT_STUBV(ITTAPI, void, id_create_ex,  (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id))
2697 ITT_STUBV(ITTAPI, void, id_destroy_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id))
2698 #define __itt_id_create_ex(d,x,y,z)  ITTNOTIFY_VOID_D3(id_create_ex,d,x,y,z)
2699 #define __itt_id_create_ex_ptr       ITTNOTIFY_NAME(id_create_ex)
2700 #define __itt_id_destroy_ex(d,x,y,z) ITTNOTIFY_VOID_D3(id_destroy_ex,d,x,y,z)
2701 #define __itt_id_destroy_ex_ptr      ITTNOTIFY_NAME(id_destroy_ex)
2702 #else  /* INTEL_NO_ITTNOTIFY_API */
2703 #define __itt_id_create_ex(domain,clock_domain,timestamp,id)
2704 #define __itt_id_create_ex_ptr    0
2705 #define __itt_id_destroy_ex(domain,clock_domain,timestamp,id)
2706 #define __itt_id_destroy_ex_ptr 0
2707 #endif /* INTEL_NO_ITTNOTIFY_API */
2708 #else  /* INTEL_NO_MACRO_BODY */
2709 #define __itt_id_create_ex_ptr    0
2710 #define __itt_id_destroy_ex_ptr 0
2711 #endif /* INTEL_NO_MACRO_BODY */
2712 /** @endcond */
2713 
2714 /**
2715  * @ingroup clockdomain
2716  * @brief Begin a task instance.
2717  * @param[in] domain The domain for this task
2718  * @param[in] clock_domain The clock domain controlling the execution of this call.
2719  * @param[in] timestamp The user defined timestamp.
2720  * @param[in] taskid The instance ID for this task instance, or __itt_null
2721  * @param[in] parentid The parent instance to which this task instance belongs, or __itt_null
2722  * @param[in] name The name of this task
2723  */
2724 void ITTAPI __itt_task_begin_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name);
2725 
2726 /**
2727  * @ingroup clockdomain
2728  * @brief Begin a task instance.
2729  * @param[in] domain The domain for this task
2730  * @param[in] clock_domain The clock domain controlling the execution of this call.
2731  * @param[in] timestamp The user defined timestamp.
2732  * @param[in] taskid The identifier for this task instance, or __itt_null
2733  * @param[in] parentid The parent of this task, or __itt_null
2734  * @param[in] fn The pointer to the function you are tracing
2735  */
2736 void ITTAPI __itt_task_begin_fn_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, void* fn);
2737 
2738 /**
2739  * @ingroup clockdomain
2740  * @brief End the current task instance.
2741  * @param[in] domain The domain for this task
2742  * @param[in] clock_domain The clock domain controlling the execution of this call.
2743  * @param[in] timestamp The user defined timestamp.
2744  */
2745 void ITTAPI __itt_task_end_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp);
2746 
2747 /** @cond exclude_from_documentation */
2748 #ifndef INTEL_NO_MACRO_BODY
2749 #ifndef INTEL_NO_ITTNOTIFY_API
2750 ITT_STUBV(ITTAPI, void, task_begin_ex,        (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, __itt_string_handle *name))
2751 ITT_STUBV(ITTAPI, void, task_begin_fn_ex,     (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_id parentid, void* fn))
2752 ITT_STUBV(ITTAPI, void, task_end_ex,          (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp))
2753 #define __itt_task_begin_ex(d,x,y,z,a,b)      ITTNOTIFY_VOID_D5(task_begin_ex,d,x,y,z,a,b)
2754 #define __itt_task_begin_ex_ptr               ITTNOTIFY_NAME(task_begin_ex)
2755 #define __itt_task_begin_fn_ex(d,x,y,z,a,b)   ITTNOTIFY_VOID_D5(task_begin_fn_ex,d,x,y,z,a,b)
2756 #define __itt_task_begin_fn_ex_ptr            ITTNOTIFY_NAME(task_begin_fn_ex)
2757 #define __itt_task_end_ex(d,x,y)              ITTNOTIFY_VOID_D2(task_end_ex,d,x,y)
2758 #define __itt_task_end_ex_ptr                 ITTNOTIFY_NAME(task_end_ex)
2759 #else  /* INTEL_NO_ITTNOTIFY_API */
2760 #define __itt_task_begin_ex(domain,clock_domain,timestamp,id,parentid,name)
2761 #define __itt_task_begin_ex_ptr          0
2762 #define __itt_task_begin_fn_ex(domain,clock_domain,timestamp,id,parentid,fn)
2763 #define __itt_task_begin_fn_ex_ptr       0
2764 #define __itt_task_end_ex(domain,clock_domain,timestamp)
2765 #define __itt_task_end_ex_ptr            0
2766 #endif /* INTEL_NO_ITTNOTIFY_API */
2767 #else  /* INTEL_NO_MACRO_BODY */
2768 #define __itt_task_begin_ex_ptr          0
2769 #define __itt_task_begin_fn_ex_ptr       0
2770 #define __itt_task_end_ex_ptr            0
2771 #endif /* INTEL_NO_MACRO_BODY */
2772 /** @endcond */
2773 
2774 /**
2775  * @defgroup counters Counters
2776  * @ingroup public
2777  * Counters are user-defined objects with a monotonically increasing
2778  * value. Counter values are 64-bit unsigned integers.
2779  * Counters have names that can be displayed in
2780  * the tools.
2781  * @{
2782  */
2783 
2784 /**
2785  * @brief opaque structure for counter identification
2786  */
2787 /** @cond exclude_from_documentation */
2788 
2789 typedef struct ___itt_counter* __itt_counter;
2790 
2791 /**
2792  * @brief Create an unsigned 64 bits integer counter with given name/domain
2793  *
2794  * After __itt_counter_create() is called, __itt_counter_inc(id), __itt_counter_inc_delta(id, delta),
2795  * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
2796  * can be used to change the value of the counter, where value_ptr is a pointer to an unsigned 64 bits integer
2797  *
2798  * The call is equal to __itt_counter_create_typed(name, domain, __itt_metadata_u64)
2799  */
2800 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2801 __itt_counter ITTAPI __itt_counter_createA(const char    *name, const char    *domain);
2802 __itt_counter ITTAPI __itt_counter_createW(const wchar_t *name, const wchar_t *domain);
2803 #if defined(UNICODE) || defined(_UNICODE)
2804 #  define __itt_counter_create     __itt_counter_createW
2805 #  define __itt_counter_create_ptr __itt_counter_createW_ptr
2806 #else /* UNICODE */
2807 #  define __itt_counter_create     __itt_counter_createA
2808 #  define __itt_counter_create_ptr __itt_counter_createA_ptr
2809 #endif /* UNICODE */
2810 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2811 __itt_counter ITTAPI __itt_counter_create(const char *name, const char *domain);
2812 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2813 
2814 #ifndef INTEL_NO_MACRO_BODY
2815 #ifndef INTEL_NO_ITTNOTIFY_API
2816 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2817 ITT_STUB(ITTAPI, __itt_counter, counter_createA, (const char    *name, const char    *domain))
2818 ITT_STUB(ITTAPI, __itt_counter, counter_createW, (const wchar_t *name, const wchar_t *domain))
2819 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2820 ITT_STUB(ITTAPI, __itt_counter, counter_create,  (const char *name, const char *domain))
2821 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2822 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2823 #define __itt_counter_createA     ITTNOTIFY_DATA(counter_createA)
2824 #define __itt_counter_createA_ptr ITTNOTIFY_NAME(counter_createA)
2825 #define __itt_counter_createW     ITTNOTIFY_DATA(counter_createW)
2826 #define __itt_counter_createW_ptr ITTNOTIFY_NAME(counter_createW)
2827 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2828 #define __itt_counter_create     ITTNOTIFY_DATA(counter_create)
2829 #define __itt_counter_create_ptr ITTNOTIFY_NAME(counter_create)
2830 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2831 #else  /* INTEL_NO_ITTNOTIFY_API */
2832 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2833 #define __itt_counter_createA(name, domain)
2834 #define __itt_counter_createA_ptr 0
2835 #define __itt_counter_createW(name, domain)
2836 #define __itt_counter_createW_ptr 0
2837 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2838 #define __itt_counter_create(name, domain)
2839 #define __itt_counter_create_ptr  0
2840 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2841 #endif /* INTEL_NO_ITTNOTIFY_API */
2842 #else  /* INTEL_NO_MACRO_BODY */
2843 #if ITT_PLATFORM==ITT_PLATFORM_WIN
2844 #define __itt_counter_createA_ptr 0
2845 #define __itt_counter_createW_ptr 0
2846 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2847 #define __itt_counter_create_ptr  0
2848 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
2849 #endif /* INTEL_NO_MACRO_BODY */
2850 /** @endcond */
2851 
2852 /**
2853  * @brief Increment the unsigned 64 bits integer counter value
2854  *
2855  * Calling this function to non-unsigned 64 bits integer counters has no effect
2856  */
2857 void ITTAPI __itt_counter_inc(__itt_counter id);
2858 
2859 #ifndef INTEL_NO_MACRO_BODY
2860 #ifndef INTEL_NO_ITTNOTIFY_API
2861 ITT_STUBV(ITTAPI, void, counter_inc, (__itt_counter id))
2862 #define __itt_counter_inc     ITTNOTIFY_VOID(counter_inc)
2863 #define __itt_counter_inc_ptr ITTNOTIFY_NAME(counter_inc)
2864 #else  /* INTEL_NO_ITTNOTIFY_API */
2865 #define __itt_counter_inc(id)
2866 #define __itt_counter_inc_ptr 0
2867 #endif /* INTEL_NO_ITTNOTIFY_API */
2868 #else  /* INTEL_NO_MACRO_BODY */
2869 #define __itt_counter_inc_ptr 0
2870 #endif /* INTEL_NO_MACRO_BODY */
2871 /** @endcond */
2872 /**
2873  * @brief Increment the unsigned 64 bits integer counter value with x
2874  *
2875  * Calling this function to non-unsigned 64 bits integer counters has no effect
2876  */
2877 void ITTAPI __itt_counter_inc_delta(__itt_counter id, unsigned long long value);
2878 
2879 #ifndef INTEL_NO_MACRO_BODY
2880 #ifndef INTEL_NO_ITTNOTIFY_API
2881 ITT_STUBV(ITTAPI, void, counter_inc_delta, (__itt_counter id, unsigned long long value))
2882 #define __itt_counter_inc_delta     ITTNOTIFY_VOID(counter_inc_delta)
2883 #define __itt_counter_inc_delta_ptr ITTNOTIFY_NAME(counter_inc_delta)
2884 #else  /* INTEL_NO_ITTNOTIFY_API */
2885 #define __itt_counter_inc_delta(id, value)
2886 #define __itt_counter_inc_delta_ptr 0
2887 #endif /* INTEL_NO_ITTNOTIFY_API */
2888 #else  /* INTEL_NO_MACRO_BODY */
2889 #define __itt_counter_inc_delta_ptr 0
2890 #endif /* INTEL_NO_MACRO_BODY */
2891 /** @endcond */
2892 
2893 /**
2894  * @brief Decrement the unsigned 64 bits integer counter value
2895  *
2896  * Calling this function to non-unsigned 64 bits integer counters has no effect
2897  */
2898 void ITTAPI __itt_counter_dec(__itt_counter id);
2899 
2900 #ifndef INTEL_NO_MACRO_BODY
2901 #ifndef INTEL_NO_ITTNOTIFY_API
2902 ITT_STUBV(ITTAPI, void, counter_dec, (__itt_counter id))
2903 #define __itt_counter_dec     ITTNOTIFY_VOID(counter_dec)
2904 #define __itt_counter_dec_ptr ITTNOTIFY_NAME(counter_dec)
2905 #else  /* INTEL_NO_ITTNOTIFY_API */
2906 #define __itt_counter_dec(id)
2907 #define __itt_counter_dec_ptr 0
2908 #endif /* INTEL_NO_ITTNOTIFY_API */
2909 #else  /* INTEL_NO_MACRO_BODY */
2910 #define __itt_counter_dec_ptr 0
2911 #endif /* INTEL_NO_MACRO_BODY */
2912 /** @endcond */
2913 /**
2914  * @brief Decrement the unsigned 64 bits integer counter value with x
2915  *
2916  * Calling this function to non-unsigned 64 bits integer counters has no effect
2917  */
2918 void ITTAPI __itt_counter_dec_delta(__itt_counter id, unsigned long long value);
2919 
2920 #ifndef INTEL_NO_MACRO_BODY
2921 #ifndef INTEL_NO_ITTNOTIFY_API
2922 ITT_STUBV(ITTAPI, void, counter_dec_delta, (__itt_counter id, unsigned long long value))
2923 #define __itt_counter_dec_delta     ITTNOTIFY_VOID(counter_dec_delta)
2924 #define __itt_counter_dec_delta_ptr ITTNOTIFY_NAME(counter_dec_delta)
2925 #else  /* INTEL_NO_ITTNOTIFY_API */
2926 #define __itt_counter_dec_delta(id, value)
2927 #define __itt_counter_dec_delta_ptr 0
2928 #endif /* INTEL_NO_ITTNOTIFY_API */
2929 #else  /* INTEL_NO_MACRO_BODY */
2930 #define __itt_counter_dec_delta_ptr 0
2931 #endif /* INTEL_NO_MACRO_BODY */
2932 /** @endcond */
2933 
2934 /**
2935  * @ingroup counters
2936  * @brief Increment a counter by one.
2937  * The first call with a given name creates a counter by that name and sets its
2938  * value to zero. Successive calls increment the counter value.
2939  * @param[in] domain The domain controlling the call. Counter names are not domain specific.
2940  *            The domain argument is used only to enable or disable the API calls.
2941  * @param[in] name The name of the counter
2942  */
2943 void ITTAPI __itt_counter_inc_v3(const __itt_domain *domain, __itt_string_handle *name);
2944 
2945 /**
2946  * @ingroup counters
2947  * @brief Increment a counter by the value specified in delta.
2948  * @param[in] domain The domain controlling the call. Counter names are not domain specific.
2949  *            The domain argument is used only to enable or disable the API calls.
2950  * @param[in] name The name of the counter
2951  * @param[in] delta The amount by which to increment the counter
2952  */
2953 void ITTAPI __itt_counter_inc_delta_v3(const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta);
2954 
2955 #ifndef INTEL_NO_MACRO_BODY
2956 #ifndef INTEL_NO_ITTNOTIFY_API
2957 ITT_STUBV(ITTAPI, void, counter_inc_v3,       (const __itt_domain *domain, __itt_string_handle *name))
2958 ITT_STUBV(ITTAPI, void, counter_inc_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta))
2959 #define __itt_counter_inc_v3(d,x)         ITTNOTIFY_VOID_D1(counter_inc_v3,d,x)
2960 #define __itt_counter_inc_v3_ptr          ITTNOTIFY_NAME(counter_inc_v3)
2961 #define __itt_counter_inc_delta_v3(d,x,y) ITTNOTIFY_VOID_D2(counter_inc_delta_v3,d,x,y)
2962 #define __itt_counter_inc_delta_v3_ptr    ITTNOTIFY_NAME(counter_inc_delta_v3)
2963 #else  /* INTEL_NO_ITTNOTIFY_API */
2964 #define __itt_counter_inc_v3(domain,name)
2965 #define __itt_counter_inc_v3_ptr       0
2966 #define __itt_counter_inc_delta_v3(domain,name,delta)
2967 #define __itt_counter_inc_delta_v3_ptr 0
2968 #endif /* INTEL_NO_ITTNOTIFY_API */
2969 #else  /* INTEL_NO_MACRO_BODY */
2970 #define __itt_counter_inc_v3_ptr       0
2971 #define __itt_counter_inc_delta_v3_ptr 0
2972 #endif /* INTEL_NO_MACRO_BODY */
2973 /** @endcond */
2974 
2975 
2976 /**
2977  * @ingroup counters
2978  * @brief Decrement a counter by one.
2979  * The first call with a given name creates a counter by that name and sets its
2980  * value to zero. Successive calls decrement the counter value.
2981  * @param[in] domain The domain controlling the call. Counter names are not domain specific.
2982  *            The domain argument is used only to enable or disable the API calls.
2983  * @param[in] name The name of the counter
2984  */
2985 void ITTAPI __itt_counter_dec_v3(const __itt_domain *domain, __itt_string_handle *name);
2986 
2987 /**
2988  * @ingroup counters
2989  * @brief Decrement a counter by the value specified in delta.
2990  * @param[in] domain The domain controlling the call. Counter names are not domain specific.
2991  *            The domain argument is used only to enable or disable the API calls.
2992  * @param[in] name The name of the counter
2993  * @param[in] delta The amount by which to decrement the counter
2994  */
2995 void ITTAPI __itt_counter_dec_delta_v3(const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta);
2996 
2997 #ifndef INTEL_NO_MACRO_BODY
2998 #ifndef INTEL_NO_ITTNOTIFY_API
2999 ITT_STUBV(ITTAPI, void, counter_dec_v3,       (const __itt_domain *domain, __itt_string_handle *name))
3000 ITT_STUBV(ITTAPI, void, counter_dec_delta_v3, (const __itt_domain *domain, __itt_string_handle *name, unsigned long long delta))
3001 #define __itt_counter_dec_v3(d,x)         ITTNOTIFY_VOID_D1(counter_dec_v3,d,x)
3002 #define __itt_counter_dec_v3_ptr          ITTNOTIFY_NAME(counter_dec_v3)
3003 #define __itt_counter_dec_delta_v3(d,x,y) ITTNOTIFY_VOID_D2(counter_dec_delta_v3,d,x,y)
3004 #define __itt_counter_dec_delta_v3_ptr    ITTNOTIFY_NAME(counter_dec_delta_v3)
3005 #else  /* INTEL_NO_ITTNOTIFY_API */
3006 #define __itt_counter_dec_v3(domain,name)
3007 #define __itt_counter_dec_v3_ptr       0
3008 #define __itt_counter_dec_delta_v3(domain,name,delta)
3009 #define __itt_counter_dec_delta_v3_ptr 0
3010 #endif /* INTEL_NO_ITTNOTIFY_API */
3011 #else  /* INTEL_NO_MACRO_BODY */
3012 #define __itt_counter_dec_v3_ptr       0
3013 #define __itt_counter_dec_delta_v3_ptr 0
3014 #endif /* INTEL_NO_MACRO_BODY */
3015 /** @endcond */
3016 
3017 /** @} counters group */
3018 
3019 
3020 /**
3021  * @brief Set the counter value
3022  */
3023 void ITTAPI __itt_counter_set_value(__itt_counter id, void *value_ptr);
3024 
3025 #ifndef INTEL_NO_MACRO_BODY
3026 #ifndef INTEL_NO_ITTNOTIFY_API
3027 ITT_STUBV(ITTAPI, void, counter_set_value, (__itt_counter id, void *value_ptr))
3028 #define __itt_counter_set_value     ITTNOTIFY_VOID(counter_set_value)
3029 #define __itt_counter_set_value_ptr ITTNOTIFY_NAME(counter_set_value)
3030 #else  /* INTEL_NO_ITTNOTIFY_API */
3031 #define __itt_counter_set_value(id, value_ptr)
3032 #define __itt_counter_set_value_ptr 0
3033 #endif /* INTEL_NO_ITTNOTIFY_API */
3034 #else  /* INTEL_NO_MACRO_BODY */
3035 #define __itt_counter_set_value_ptr 0
3036 #endif /* INTEL_NO_MACRO_BODY */
3037 /** @endcond */
3038 
3039 /**
3040  * @brief Set the counter value
3041  */
3042 void ITTAPI __itt_counter_set_value_ex(__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr);
3043 
3044 /** @cond exclude_from_documentation */
3045 #ifndef INTEL_NO_MACRO_BODY
3046 #ifndef INTEL_NO_ITTNOTIFY_API
3047 ITT_STUBV(ITTAPI, void, counter_set_value_ex, (__itt_counter id, __itt_clock_domain *clock_domain, unsigned long long timestamp, void *value_ptr))
3048 #define __itt_counter_set_value_ex     ITTNOTIFY_VOID(counter_set_value_ex)
3049 #define __itt_counter_set_value_ex_ptr ITTNOTIFY_NAME(counter_set_value_ex)
3050 #else  /* INTEL_NO_ITTNOTIFY_API */
3051 #define __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
3052 #define __itt_counter_set_value_ex_ptr 0
3053 #endif /* INTEL_NO_ITTNOTIFY_API */
3054 #else  /* INTEL_NO_MACRO_BODY */
3055 #define __itt_counter_set_value_ex_ptr 0
3056 #endif /* INTEL_NO_MACRO_BODY */
3057 /** @endcond */
3058 
3059 /**
3060  * @brief Create a typed counter with given name/domain
3061  *
3062  * After __itt_counter_create_typed() is called, __itt_counter_inc(id), __itt_counter_inc_delta(id, delta),
3063  * __itt_counter_set_value(id, value_ptr) or __itt_counter_set_value_ex(id, clock_domain, timestamp, value_ptr)
3064  * can be used to change the value of the counter
3065  */
3066 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3067 __itt_counter ITTAPI __itt_counter_create_typedA(const char    *name, const char    *domain, __itt_metadata_type type);
3068 __itt_counter ITTAPI __itt_counter_create_typedW(const wchar_t *name, const wchar_t *domain, __itt_metadata_type type);
3069 #if defined(UNICODE) || defined(_UNICODE)
3070 #  define __itt_counter_create_typed     __itt_counter_create_typedW
3071 #  define __itt_counter_create_typed_ptr __itt_counter_create_typedW_ptr
3072 #else /* UNICODE */
3073 #  define __itt_counter_create_typed     __itt_counter_create_typedA
3074 #  define __itt_counter_create_typed_ptr __itt_counter_create_typedA_ptr
3075 #endif /* UNICODE */
3076 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3077 __itt_counter ITTAPI __itt_counter_create_typed(const char *name, const char *domain, __itt_metadata_type type);
3078 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3079 
3080 #ifndef INTEL_NO_MACRO_BODY
3081 #ifndef INTEL_NO_ITTNOTIFY_API
3082 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3083 ITT_STUB(ITTAPI, __itt_counter, counter_create_typedA, (const char    *name, const char    *domain, __itt_metadata_type type))
3084 ITT_STUB(ITTAPI, __itt_counter, counter_create_typedW, (const wchar_t *name, const wchar_t *domain, __itt_metadata_type type))
3085 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3086 ITT_STUB(ITTAPI, __itt_counter, counter_create_typed,  (const char *name, const char *domain, __itt_metadata_type type))
3087 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3088 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3089 #define __itt_counter_create_typedA     ITTNOTIFY_DATA(counter_create_typedA)
3090 #define __itt_counter_create_typedA_ptr ITTNOTIFY_NAME(counter_create_typedA)
3091 #define __itt_counter_create_typedW     ITTNOTIFY_DATA(counter_create_typedW)
3092 #define __itt_counter_create_typedW_ptr ITTNOTIFY_NAME(counter_create_typedW)
3093 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3094 #define __itt_counter_create_typed     ITTNOTIFY_DATA(counter_create_typed)
3095 #define __itt_counter_create_typed_ptr ITTNOTIFY_NAME(counter_create_typed)
3096 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3097 #else  /* INTEL_NO_ITTNOTIFY_API */
3098 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3099 #define __itt_counter_create_typedA(name, domain, type)
3100 #define __itt_counter_create_typedA_ptr 0
3101 #define __itt_counter_create_typedW(name, domain, type)
3102 #define __itt_counter_create_typedW_ptr 0
3103 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3104 #define __itt_counter_create_typed(name, domain, type)
3105 #define __itt_counter_create_typed_ptr  0
3106 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3107 #endif /* INTEL_NO_ITTNOTIFY_API */
3108 #else  /* INTEL_NO_MACRO_BODY */
3109 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3110 #define __itt_counter_create_typedA_ptr 0
3111 #define __itt_counter_create_typedW_ptr 0
3112 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3113 #define __itt_counter_create_typed_ptr  0
3114 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3115 #endif /* INTEL_NO_MACRO_BODY */
3116 /** @endcond */
3117 
3118 /**
3119  * @brief Destroy the counter identified by the pointer previously returned by __itt_counter_create() or
3120  * __itt_counter_create_typed()
3121  */
3122 void ITTAPI __itt_counter_destroy(__itt_counter id);
3123 
3124 #ifndef INTEL_NO_MACRO_BODY
3125 #ifndef INTEL_NO_ITTNOTIFY_API
3126 ITT_STUBV(ITTAPI, void, counter_destroy, (__itt_counter id))
3127 #define __itt_counter_destroy     ITTNOTIFY_VOID(counter_destroy)
3128 #define __itt_counter_destroy_ptr ITTNOTIFY_NAME(counter_destroy)
3129 #else  /* INTEL_NO_ITTNOTIFY_API */
3130 #define __itt_counter_destroy(id)
3131 #define __itt_counter_destroy_ptr 0
3132 #endif /* INTEL_NO_ITTNOTIFY_API */
3133 #else  /* INTEL_NO_MACRO_BODY */
3134 #define __itt_counter_destroy_ptr 0
3135 #endif /* INTEL_NO_MACRO_BODY */
3136 /** @endcond */
3137 /** @} counters group */
3138 
3139 /**
3140  * @ingroup markers
3141  * @brief Create a marker instance.
3142  * @param[in] domain The domain for this marker
3143  * @param[in] clock_domain The clock domain controlling the execution of this call.
3144  * @param[in] timestamp The user defined timestamp.
3145  * @param[in] id The instance ID for this marker, or __itt_null
3146  * @param[in] name The name for this marker
3147  * @param[in] scope The scope for this marker
3148  */
3149 void ITTAPI __itt_marker_ex(const __itt_domain *domain,  __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope);
3150 
3151 /** @cond exclude_from_documentation */
3152 #ifndef INTEL_NO_MACRO_BODY
3153 #ifndef INTEL_NO_ITTNOTIFY_API
3154 ITT_STUBV(ITTAPI, void, marker_ex,    (const __itt_domain *domain,  __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id id, __itt_string_handle *name, __itt_scope scope))
3155 #define __itt_marker_ex(d,x,y,z,a,b)    ITTNOTIFY_VOID_D5(marker_ex,d,x,y,z,a,b)
3156 #define __itt_marker_ex_ptr             ITTNOTIFY_NAME(marker_ex)
3157 #else  /* INTEL_NO_ITTNOTIFY_API */
3158 #define __itt_marker_ex(domain,clock_domain,timestamp,id,name,scope)
3159 #define __itt_marker_ex_ptr    0
3160 #endif /* INTEL_NO_ITTNOTIFY_API */
3161 #else  /* INTEL_NO_MACRO_BODY */
3162 #define __itt_marker_ex_ptr    0
3163 #endif /* INTEL_NO_MACRO_BODY */
3164 /** @endcond */
3165 
3166 /**
3167  * @ingroup clockdomain
3168  * @brief Add a relation to the current task instance.
3169  * The current task instance is the head of the relation.
3170  * @param[in] domain The domain controlling this call
3171  * @param[in] clock_domain The clock domain controlling the execution of this call.
3172  * @param[in] timestamp The user defined timestamp.
3173  * @param[in] relation The kind of relation
3174  * @param[in] tail The ID for the tail of the relation
3175  */
3176 void ITTAPI __itt_relation_add_to_current_ex(const __itt_domain *domain,  __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail);
3177 
3178 /**
3179  * @ingroup clockdomain
3180  * @brief Add a relation between two instance identifiers.
3181  * @param[in] domain The domain controlling this call
3182  * @param[in] clock_domain The clock domain controlling the execution of this call.
3183  * @param[in] timestamp The user defined timestamp.
3184  * @param[in] head The ID for the head of the relation
3185  * @param[in] relation The kind of relation
3186  * @param[in] tail The ID for the tail of the relation
3187  */
3188 void ITTAPI __itt_relation_add_ex(const __itt_domain *domain,  __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail);
3189 
3190 /** @cond exclude_from_documentation */
3191 #ifndef INTEL_NO_MACRO_BODY
3192 #ifndef INTEL_NO_ITTNOTIFY_API
3193 ITT_STUBV(ITTAPI, void, relation_add_to_current_ex, (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_relation relation, __itt_id tail))
3194 ITT_STUBV(ITTAPI, void, relation_add_ex,            (const __itt_domain *domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id head, __itt_relation relation, __itt_id tail))
3195 #define __itt_relation_add_to_current_ex(d,x,y,z,a) ITTNOTIFY_VOID_D4(relation_add_to_current_ex,d,x,y,z,a)
3196 #define __itt_relation_add_to_current_ex_ptr        ITTNOTIFY_NAME(relation_add_to_current_ex)
3197 #define __itt_relation_add_ex(d,x,y,z,a,b)          ITTNOTIFY_VOID_D5(relation_add_ex,d,x,y,z,a,b)
3198 #define __itt_relation_add_ex_ptr                   ITTNOTIFY_NAME(relation_add_ex)
3199 #else  /* INTEL_NO_ITTNOTIFY_API */
3200 #define __itt_relation_add_to_current_ex(domain,clock_domain,timestame,relation,tail)
3201 #define __itt_relation_add_to_current_ex_ptr 0
3202 #define __itt_relation_add_ex(domain,clock_domain,timestamp,head,relation,tail)
3203 #define __itt_relation_add_ex_ptr 0
3204 #endif /* INTEL_NO_ITTNOTIFY_API */
3205 #else  /* INTEL_NO_MACRO_BODY */
3206 #define __itt_relation_add_to_current_ex_ptr 0
3207 #define __itt_relation_add_ex_ptr 0
3208 #endif /* INTEL_NO_MACRO_BODY */
3209 /** @endcond */
3210 
3211 /** @cond exclude_from_documentation */
3212 typedef enum ___itt_track_group_type
3213 {
3214     __itt_track_group_type_normal = 0
3215 } __itt_track_group_type;
3216 /** @endcond */
3217 
3218 /** @cond exclude_from_documentation */
3219 #pragma pack(push, 8)
3220 
3221 typedef struct ___itt_track_group
3222 {
3223     __itt_string_handle* name;     /*!< Name of the track group */
3224     struct ___itt_track* track;    /*!< List of child tracks    */
3225     __itt_track_group_type tgtype; /*!< Type of the track group */
3226     int   extra1;                  /*!< Reserved. Must be zero  */
3227     void* extra2;                  /*!< Reserved. Must be zero  */
3228     struct ___itt_track_group* next;
3229 } __itt_track_group;
3230 
3231 #pragma pack(pop)
3232 /** @endcond */
3233 
3234 /**
3235  * @brief Placeholder for custom track types. Currently, "normal" custom track
3236  * is the only available track type.
3237  */
3238 typedef enum ___itt_track_type
3239 {
3240     __itt_track_type_normal = 0
3241 #ifdef INTEL_ITTNOTIFY_API_PRIVATE
3242     , __itt_track_type_queue
3243 #endif /* INTEL_ITTNOTIFY_API_PRIVATE */
3244 } __itt_track_type;
3245 
3246 /** @cond exclude_from_documentation */
3247 #pragma pack(push, 8)
3248 
3249 typedef struct ___itt_track
3250 {
3251     __itt_string_handle* name; /*!< Name of the track group */
3252     __itt_track_group* group;  /*!< Parent group to a track */
3253     __itt_track_type ttype;    /*!< Type of the track       */
3254     int   extra1;              /*!< Reserved. Must be zero  */
3255     void* extra2;              /*!< Reserved. Must be zero  */
3256     struct ___itt_track* next;
3257 } __itt_track;
3258 
3259 #pragma pack(pop)
3260 /** @endcond */
3261 
3262 /**
3263  * @brief Create logical track group.
3264  */
3265 __itt_track_group* ITTAPI __itt_track_group_create(__itt_string_handle* name, __itt_track_group_type track_group_type);
3266 
3267 /** @cond exclude_from_documentation */
3268 #ifndef INTEL_NO_MACRO_BODY
3269 #ifndef INTEL_NO_ITTNOTIFY_API
3270 ITT_STUB(ITTAPI, __itt_track_group*, track_group_create, (__itt_string_handle* name, __itt_track_group_type track_group_type))
3271 #define __itt_track_group_create     ITTNOTIFY_DATA(track_group_create)
3272 #define __itt_track_group_create_ptr ITTNOTIFY_NAME(track_group_create)
3273 #else  /* INTEL_NO_ITTNOTIFY_API */
3274 #define __itt_track_group_create(name)  (__itt_track_group*)0
3275 #define __itt_track_group_create_ptr 0
3276 #endif /* INTEL_NO_ITTNOTIFY_API */
3277 #else  /* INTEL_NO_MACRO_BODY */
3278 #define __itt_track_group_create_ptr 0
3279 #endif /* INTEL_NO_MACRO_BODY */
3280 /** @endcond */
3281 
3282 /**
3283  * @brief Create logical track.
3284  */
3285 __itt_track* ITTAPI __itt_track_create(__itt_track_group* track_group, __itt_string_handle* name, __itt_track_type track_type);
3286 
3287 /** @cond exclude_from_documentation */
3288 #ifndef INTEL_NO_MACRO_BODY
3289 #ifndef INTEL_NO_ITTNOTIFY_API
3290 ITT_STUB(ITTAPI, __itt_track*, track_create, (__itt_track_group* track_group,__itt_string_handle* name, __itt_track_type track_type))
3291 #define __itt_track_create     ITTNOTIFY_DATA(track_create)
3292 #define __itt_track_create_ptr ITTNOTIFY_NAME(track_create)
3293 #else  /* INTEL_NO_ITTNOTIFY_API */
3294 #define __itt_track_create(track_group,name,track_type)  (__itt_track*)0
3295 #define __itt_track_create_ptr 0
3296 #endif /* INTEL_NO_ITTNOTIFY_API */
3297 #else  /* INTEL_NO_MACRO_BODY */
3298 #define __itt_track_create_ptr 0
3299 #endif /* INTEL_NO_MACRO_BODY */
3300 /** @endcond */
3301 
3302 /**
3303  * @brief Set the logical track.
3304  */
3305 void ITTAPI __itt_set_track(__itt_track* track);
3306 
3307 /** @cond exclude_from_documentation */
3308 #ifndef INTEL_NO_MACRO_BODY
3309 #ifndef INTEL_NO_ITTNOTIFY_API
3310 ITT_STUBV(ITTAPI, void, set_track, (__itt_track *track))
3311 #define __itt_set_track     ITTNOTIFY_VOID(set_track)
3312 #define __itt_set_track_ptr ITTNOTIFY_NAME(set_track)
3313 #else  /* INTEL_NO_ITTNOTIFY_API */
3314 #define __itt_set_track(track)
3315 #define __itt_set_track_ptr 0
3316 #endif /* INTEL_NO_ITTNOTIFY_API */
3317 #else  /* INTEL_NO_MACRO_BODY */
3318 #define __itt_set_track_ptr 0
3319 #endif /* INTEL_NO_MACRO_BODY */
3320 /** @endcond */
3321 
3322 /* ========================================================================== */
3323 /** @cond exclude_from_gpa_documentation */
3324 /**
3325  * @defgroup events Events
3326  * @ingroup public
3327  * Events group
3328  * @{
3329  */
3330 /** @brief user event type */
3331 typedef int __itt_event;
3332 
3333 /**
3334  * @brief Create an event notification
3335  * @note name or namelen being null/name and namelen not matching, user event feature not enabled
3336  * @return non-zero event identifier upon success and __itt_err otherwise
3337  */
3338 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3339 __itt_event LIBITTAPI __itt_event_createA(const char    *name, int namelen);
3340 __itt_event LIBITTAPI __itt_event_createW(const wchar_t *name, int namelen);
3341 #if defined(UNICODE) || defined(_UNICODE)
3342 #  define __itt_event_create     __itt_event_createW
3343 #  define __itt_event_create_ptr __itt_event_createW_ptr
3344 #else
3345 #  define __itt_event_create     __itt_event_createA
3346 #  define __itt_event_create_ptr __itt_event_createA_ptr
3347 #endif /* UNICODE */
3348 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3349 __itt_event LIBITTAPI __itt_event_create(const char *name, int namelen);
3350 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3351 
3352 /** @cond exclude_from_documentation */
3353 #ifndef INTEL_NO_MACRO_BODY
3354 #ifndef INTEL_NO_ITTNOTIFY_API
3355 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3356 ITT_STUB(LIBITTAPI, __itt_event, event_createA, (const char    *name, int namelen))
3357 ITT_STUB(LIBITTAPI, __itt_event, event_createW, (const wchar_t *name, int namelen))
3358 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3359 ITT_STUB(LIBITTAPI, __itt_event, event_create,  (const char    *name, int namelen))
3360 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3361 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3362 #define __itt_event_createA     ITTNOTIFY_DATA(event_createA)
3363 #define __itt_event_createA_ptr ITTNOTIFY_NAME(event_createA)
3364 #define __itt_event_createW     ITTNOTIFY_DATA(event_createW)
3365 #define __itt_event_createW_ptr ITTNOTIFY_NAME(event_createW)
3366 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3367 #define __itt_event_create      ITTNOTIFY_DATA(event_create)
3368 #define __itt_event_create_ptr  ITTNOTIFY_NAME(event_create)
3369 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3370 #else  /* INTEL_NO_ITTNOTIFY_API */
3371 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3372 #define __itt_event_createA(name, namelen) (__itt_event)0
3373 #define __itt_event_createA_ptr 0
3374 #define __itt_event_createW(name, namelen) (__itt_event)0
3375 #define __itt_event_createW_ptr 0
3376 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3377 #define __itt_event_create(name, namelen)  (__itt_event)0
3378 #define __itt_event_create_ptr  0
3379 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3380 #endif /* INTEL_NO_ITTNOTIFY_API */
3381 #else  /* INTEL_NO_MACRO_BODY */
3382 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3383 #define __itt_event_createA_ptr 0
3384 #define __itt_event_createW_ptr 0
3385 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3386 #define __itt_event_create_ptr  0
3387 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3388 #endif /* INTEL_NO_MACRO_BODY */
3389 /** @endcond */
3390 
3391 /**
3392  * @brief Record an event occurrence.
3393  * @return __itt_err upon failure (invalid event id/user event feature not enabled)
3394  */
3395 int LIBITTAPI __itt_event_start(__itt_event event);
3396 
3397 /** @cond exclude_from_documentation */
3398 #ifndef INTEL_NO_MACRO_BODY
3399 #ifndef INTEL_NO_ITTNOTIFY_API
3400 ITT_STUB(LIBITTAPI, int, event_start, (__itt_event event))
3401 #define __itt_event_start     ITTNOTIFY_DATA(event_start)
3402 #define __itt_event_start_ptr ITTNOTIFY_NAME(event_start)
3403 #else  /* INTEL_NO_ITTNOTIFY_API */
3404 #define __itt_event_start(event) (int)0
3405 #define __itt_event_start_ptr 0
3406 #endif /* INTEL_NO_ITTNOTIFY_API */
3407 #else  /* INTEL_NO_MACRO_BODY */
3408 #define __itt_event_start_ptr 0
3409 #endif /* INTEL_NO_MACRO_BODY */
3410 /** @endcond */
3411 
3412 /**
3413  * @brief Record an event end occurrence.
3414  * @note It is optional if events do not have durations.
3415  * @return __itt_err upon failure (invalid event id/user event feature not enabled)
3416  */
3417 int LIBITTAPI __itt_event_end(__itt_event event);
3418 
3419 /** @cond exclude_from_documentation */
3420 #ifndef INTEL_NO_MACRO_BODY
3421 #ifndef INTEL_NO_ITTNOTIFY_API
3422 ITT_STUB(LIBITTAPI, int, event_end, (__itt_event event))
3423 #define __itt_event_end     ITTNOTIFY_DATA(event_end)
3424 #define __itt_event_end_ptr ITTNOTIFY_NAME(event_end)
3425 #else  /* INTEL_NO_ITTNOTIFY_API */
3426 #define __itt_event_end(event) (int)0
3427 #define __itt_event_end_ptr 0
3428 #endif /* INTEL_NO_ITTNOTIFY_API */
3429 #else  /* INTEL_NO_MACRO_BODY */
3430 #define __itt_event_end_ptr 0
3431 #endif /* INTEL_NO_MACRO_BODY */
3432 /** @endcond */
3433 /** @} events group */
3434 
3435 
3436 /**
3437  * @defgroup arrays Arrays Visualizer
3438  * @ingroup public
3439  * Visualize arrays
3440  * @{
3441  */
3442 
3443 /**
3444  * @enum __itt_av_data_type
3445  * @brief Defines types of arrays data (for C/C++ intrinsic types)
3446  */
3447 typedef enum
3448 {
3449     __itt_e_first = 0,
3450     __itt_e_char = 0,  /* 1-byte integer */
3451     __itt_e_uchar,     /* 1-byte unsigned integer */
3452     __itt_e_int16,     /* 2-byte integer */
3453     __itt_e_uint16,    /* 2-byte unsigned integer  */
3454     __itt_e_int32,     /* 4-byte integer */
3455     __itt_e_uint32,    /* 4-byte unsigned integer */
3456     __itt_e_int64,     /* 8-byte integer */
3457     __itt_e_uint64,    /* 8-byte unsigned integer */
3458     __itt_e_float,     /* 4-byte floating */
3459     __itt_e_double,    /* 8-byte floating */
3460     __itt_e_last = __itt_e_double
3461 } __itt_av_data_type;
3462 
3463 /**
3464  * @brief Save an array data to a file.
3465  * Output format is defined by the file extension. The csv and bmp formats are supported (bmp - for 2-dimensional array only).
3466  * @param[in] data - pointer to the array data
3467  * @param[in] rank - the rank of the array
3468  * @param[in] dimensions - pointer to an array of integers, which specifies the array dimensions.
3469  * The size of dimensions must be equal to the rank
3470  * @param[in] type - the type of the array, specified as one of the __itt_av_data_type values (for intrinsic types)
3471  * @param[in] filePath - the file path; the output format is defined by the file extension
3472  * @param[in] columnOrder - defines how the array is stored in the linear memory.
3473  * It should be 1 for column-major order (e.g. in FORTRAN) or 0 - for row-major order (e.g. in C).
3474  */
3475 
3476 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3477 int ITTAPI __itt_av_saveA(void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder);
3478 int ITTAPI __itt_av_saveW(void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder);
3479 #if defined(UNICODE) || defined(_UNICODE)
3480 #  define __itt_av_save     __itt_av_saveW
3481 #  define __itt_av_save_ptr __itt_av_saveW_ptr
3482 #else /* UNICODE */
3483 #  define __itt_av_save     __itt_av_saveA
3484 #  define __itt_av_save_ptr __itt_av_saveA_ptr
3485 #endif /* UNICODE */
3486 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3487 int ITTAPI __itt_av_save(void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder);
3488 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3489 
3490 /** @cond exclude_from_documentation */
3491 #ifndef INTEL_NO_MACRO_BODY
3492 #ifndef INTEL_NO_ITTNOTIFY_API
3493 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3494 ITT_STUB(ITTAPI, int, av_saveA, (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder))
3495 ITT_STUB(ITTAPI, int, av_saveW, (void *data, int rank, const int *dimensions, int type, const wchar_t *filePath, int columnOrder))
3496 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3497 ITT_STUB(ITTAPI, int, av_save,  (void *data, int rank, const int *dimensions, int type, const char *filePath, int columnOrder))
3498 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3499 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3500 #define __itt_av_saveA     ITTNOTIFY_DATA(av_saveA)
3501 #define __itt_av_saveA_ptr ITTNOTIFY_NAME(av_saveA)
3502 #define __itt_av_saveW     ITTNOTIFY_DATA(av_saveW)
3503 #define __itt_av_saveW_ptr ITTNOTIFY_NAME(av_saveW)
3504 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3505 #define __itt_av_save     ITTNOTIFY_DATA(av_save)
3506 #define __itt_av_save_ptr ITTNOTIFY_NAME(av_save)
3507 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3508 #else  /* INTEL_NO_ITTNOTIFY_API */
3509 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3510 #define __itt_av_saveA(name)
3511 #define __itt_av_saveA_ptr 0
3512 #define __itt_av_saveW(name)
3513 #define __itt_av_saveW_ptr 0
3514 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3515 #define __itt_av_save(name)
3516 #define __itt_av_save_ptr 0
3517 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3518 #endif /* INTEL_NO_ITTNOTIFY_API */
3519 #else  /* INTEL_NO_MACRO_BODY */
3520 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3521 #define __itt_av_saveA_ptr 0
3522 #define __itt_av_saveW_ptr 0
3523 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3524 #define __itt_av_save_ptr 0
3525 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3526 #endif /* INTEL_NO_MACRO_BODY */
3527 /** @endcond */
3528 
3529 void ITTAPI __itt_enable_attach(void);
3530 
3531 /** @cond exclude_from_documentation */
3532 #ifndef INTEL_NO_MACRO_BODY
3533 #ifndef INTEL_NO_ITTNOTIFY_API
3534 ITT_STUBV(ITTAPI, void, enable_attach, (void))
3535 #define __itt_enable_attach     ITTNOTIFY_VOID(enable_attach)
3536 #define __itt_enable_attach_ptr ITTNOTIFY_NAME(enable_attach)
3537 #else  /* INTEL_NO_ITTNOTIFY_API */
3538 #define __itt_enable_attach()
3539 #define __itt_enable_attach_ptr 0
3540 #endif /* INTEL_NO_ITTNOTIFY_API */
3541 #else  /* INTEL_NO_MACRO_BODY */
3542 #define __itt_enable_attach_ptr 0
3543 #endif /* INTEL_NO_MACRO_BODY */
3544 /** @endcond */
3545 
3546 /** @cond exclude_from_gpa_documentation */
3547 
3548 /** @} arrays group */
3549 
3550 /** @endcond */
3551 
3552 /**
3553  * @brief Module load info
3554  * This API is used to report necessary information in case of module relocation
3555  * @param[in] start_addr - relocated module start address
3556  * @param[in] end_addr - relocated module end address
3557  * @param[in] path - file system path to the module
3558  */
3559 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3560 void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr, const char *path);
3561 void ITTAPI __itt_module_loadW(void *start_addr, void *end_addr, const wchar_t *path);
3562 #if defined(UNICODE) || defined(_UNICODE)
3563 #  define __itt_module_load     __itt_module_loadW
3564 #  define __itt_module_load_ptr __itt_module_loadW_ptr
3565 #else /* UNICODE */
3566 #  define __itt_module_load     __itt_module_loadA
3567 #  define __itt_module_load_ptr __itt_module_loadA_ptr
3568 #endif /* UNICODE */
3569 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3570 void ITTAPI __itt_module_load(void *start_addr, void *end_addr, const char *path);
3571 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3572 
3573 /** @cond exclude_from_documentation */
3574 #ifndef INTEL_NO_MACRO_BODY
3575 #ifndef INTEL_NO_ITTNOTIFY_API
3576 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3577 ITT_STUB(ITTAPI, void, module_loadA, (void *start_addr, void *end_addr, const char *path))
3578 ITT_STUB(ITTAPI, void, module_loadW, (void *start_addr, void *end_addr, const wchar_t *path))
3579 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3580 ITT_STUB(ITTAPI, void, module_load,  (void *start_addr, void *end_addr, const char *path))
3581 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3582 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3583 #define __itt_module_loadA     ITTNOTIFY_VOID(module_loadA)
3584 #define __itt_module_loadA_ptr ITTNOTIFY_NAME(module_loadA)
3585 #define __itt_module_loadW     ITTNOTIFY_VOID(module_loadW)
3586 #define __itt_module_loadW_ptr ITTNOTIFY_NAME(module_loadW)
3587 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3588 #define __itt_module_load     ITTNOTIFY_VOID(module_load)
3589 #define __itt_module_load_ptr ITTNOTIFY_NAME(module_load)
3590 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3591 #else  /* INTEL_NO_ITTNOTIFY_API */
3592 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3593 #define __itt_module_loadA(start_addr, end_addr, path)
3594 #define __itt_module_loadA_ptr 0
3595 #define __itt_module_loadW(start_addr, end_addr, path)
3596 #define __itt_module_loadW_ptr 0
3597 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3598 #define __itt_module_load(start_addr, end_addr, path)
3599 #define __itt_module_load_ptr 0
3600 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3601 #endif /* INTEL_NO_ITTNOTIFY_API */
3602 #else  /* INTEL_NO_MACRO_BODY */
3603 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3604 #define __itt_module_loadA_ptr 0
3605 #define __itt_module_loadW_ptr 0
3606 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3607 #define __itt_module_load_ptr  0
3608 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3609 #endif /* INTEL_NO_MACRO_BODY */
3610 /** @endcond */
3611 
3612 
3613 
3614 #ifdef __cplusplus
3615 }
3616 #endif /* __cplusplus */
3617 
3618 #endif /* _ITTNOTIFY_H_ */
3619 
3620 #ifdef INTEL_ITTNOTIFY_API_PRIVATE
3621 
3622 #ifndef _ITTNOTIFY_PRIVATE_
3623 #define _ITTNOTIFY_PRIVATE_
3624 
3625 #ifdef __cplusplus
3626 extern "C" {
3627 #endif /* __cplusplus */
3628 
3629 /**
3630  * @ingroup clockdomain
3631  * @brief Begin an overlapped task instance.
3632  * @param[in] domain The domain for this task
3633  * @param[in] clock_domain The clock domain controlling the execution of this call.
3634  * @param[in] timestamp The user defined timestamp.
3635  * @param[in] taskid The identifier for this task instance, *cannot* be __itt_null.
3636  * @param[in] parentid The parent of this task, or __itt_null.
3637  * @param[in] name The name of this task.
3638  */
3639 void ITTAPI __itt_task_begin_overlapped_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name);
3640 
3641 /**
3642  * @ingroup clockdomain
3643  * @brief End an overlapped task instance.
3644  * @param[in] domain The domain for this task
3645  * @param[in] clock_domain The clock domain controlling the execution of this call.
3646  * @param[in] timestamp The user defined timestamp.
3647  * @param[in] taskid Explicit ID of finished task
3648  */
3649 void ITTAPI __itt_task_end_overlapped_ex(const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid);
3650 
3651 /** @cond exclude_from_documentation */
3652 #ifndef INTEL_NO_MACRO_BODY
3653 #ifndef INTEL_NO_ITTNOTIFY_API
3654 ITT_STUBV(ITTAPI, void, task_begin_overlapped_ex,       (const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid, __itt_id parentid, __itt_string_handle* name))
3655 ITT_STUBV(ITTAPI, void, task_end_overlapped_ex,         (const __itt_domain* domain, __itt_clock_domain* clock_domain, unsigned long long timestamp, __itt_id taskid))
3656 #define __itt_task_begin_overlapped_ex(d,x,y,z,a,b)     ITTNOTIFY_VOID_D5(task_begin_overlapped_ex,d,x,y,z,a,b)
3657 #define __itt_task_begin_overlapped_ex_ptr              ITTNOTIFY_NAME(task_begin_overlapped_ex)
3658 #define __itt_task_end_overlapped_ex(d,x,y,z)           ITTNOTIFY_VOID_D3(task_end_overlapped_ex,d,x,y,z)
3659 #define __itt_task_end_overlapped_ex_ptr                ITTNOTIFY_NAME(task_end_overlapped_ex)
3660 #else  /* INTEL_NO_ITTNOTIFY_API */
3661 #define __itt_task_begin_overlapped_ex(domain,clock_domain,timestamp,taskid,parentid,name)
3662 #define __itt_task_begin_overlapped_ex_ptr      0
3663 #define __itt_task_end_overlapped_ex(domain,clock_domain,timestamp,taskid)
3664 #define __itt_task_end_overlapped_ex_ptr        0
3665 #endif /* INTEL_NO_ITTNOTIFY_API */
3666 #else  /* INTEL_NO_MACRO_BODY */
3667 #define __itt_task_begin_overlapped_ex_ptr      0
3668 #define __itt_task_end_overlapped_ptr           0
3669 #define __itt_task_end_overlapped_ex_ptr        0
3670 #endif /* INTEL_NO_MACRO_BODY */
3671 /** @endcond */
3672 
3673 /**
3674  * @defgroup makrs_internal Marks
3675  * @ingroup internal
3676  * Marks group
3677  * @warning Internal API:
3678  *   - It is not shipped to outside of Intel
3679  *   - It is delivered to internal Intel teams using e-mail or SVN access only
3680  * @{
3681  */
3682 /** @brief user mark type */
3683 typedef int __itt_mark_type;
3684 
3685 /**
3686  * @brief Creates a user mark type with the specified name using char or Unicode string.
3687  * @param[in] name - name of mark to create
3688  * @return Returns a handle to the mark type
3689  */
3690 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3691 __itt_mark_type ITTAPI __itt_mark_createA(const char    *name);
3692 __itt_mark_type ITTAPI __itt_mark_createW(const wchar_t *name);
3693 #if defined(UNICODE) || defined(_UNICODE)
3694 #  define __itt_mark_create     __itt_mark_createW
3695 #  define __itt_mark_create_ptr __itt_mark_createW_ptr
3696 #else /* UNICODE */
3697 #  define __itt_mark_create     __itt_mark_createA
3698 #  define __itt_mark_create_ptr __itt_mark_createA_ptr
3699 #endif /* UNICODE */
3700 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3701 __itt_mark_type ITTAPI __itt_mark_create(const char *name);
3702 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3703 
3704 /** @cond exclude_from_documentation */
3705 #ifndef INTEL_NO_MACRO_BODY
3706 #ifndef INTEL_NO_ITTNOTIFY_API
3707 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3708 ITT_STUB(ITTAPI, __itt_mark_type, mark_createA, (const char    *name))
3709 ITT_STUB(ITTAPI, __itt_mark_type, mark_createW, (const wchar_t *name))
3710 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3711 ITT_STUB(ITTAPI, __itt_mark_type, mark_create,  (const char *name))
3712 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3713 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3714 #define __itt_mark_createA     ITTNOTIFY_DATA(mark_createA)
3715 #define __itt_mark_createA_ptr ITTNOTIFY_NAME(mark_createA)
3716 #define __itt_mark_createW     ITTNOTIFY_DATA(mark_createW)
3717 #define __itt_mark_createW_ptr ITTNOTIFY_NAME(mark_createW)
3718 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3719 #define __itt_mark_create      ITTNOTIFY_DATA(mark_create)
3720 #define __itt_mark_create_ptr  ITTNOTIFY_NAME(mark_create)
3721 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3722 #else  /* INTEL_NO_ITTNOTIFY_API */
3723 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3724 #define __itt_mark_createA(name) (__itt_mark_type)0
3725 #define __itt_mark_createA_ptr 0
3726 #define __itt_mark_createW(name) (__itt_mark_type)0
3727 #define __itt_mark_createW_ptr 0
3728 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3729 #define __itt_mark_create(name)  (__itt_mark_type)0
3730 #define __itt_mark_create_ptr  0
3731 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3732 #endif /* INTEL_NO_ITTNOTIFY_API */
3733 #else  /* INTEL_NO_MACRO_BODY */
3734 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3735 #define __itt_mark_createA_ptr 0
3736 #define __itt_mark_createW_ptr 0
3737 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3738 #define __itt_mark_create_ptr  0
3739 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3740 #endif /* INTEL_NO_MACRO_BODY */
3741 /** @endcond */
3742 
3743 /**
3744  * @brief Creates a "discrete" user mark type of the specified type and an optional parameter using char or Unicode string.
3745  *
3746  * - The mark of "discrete" type is placed to collection results in case of success. It appears in overtime view(s) as a special tick sign.
3747  * - The call is "synchronous" - function returns after mark is actually added to results.
3748  * - This function is useful, for example, to mark different phases of application
3749  *   (beginning of the next mark automatically meand end of current region).
3750  * - Can be used together with "continuous" marks (see below) at the same collection session
3751  * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
3752  * @param[in] parameter - string parameter of mark
3753  * @return Returns zero value in case of success, non-zero value otherwise.
3754  */
3755 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3756 int ITTAPI __itt_markA(__itt_mark_type mt, const char    *parameter);
3757 int ITTAPI __itt_markW(__itt_mark_type mt, const wchar_t *parameter);
3758 #if defined(UNICODE) || defined(_UNICODE)
3759 #  define __itt_mark     __itt_markW
3760 #  define __itt_mark_ptr __itt_markW_ptr
3761 #else /* UNICODE  */
3762 #  define __itt_mark     __itt_markA
3763 #  define __itt_mark_ptr __itt_markA_ptr
3764 #endif /* UNICODE */
3765 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3766 int ITTAPI __itt_mark(__itt_mark_type mt, const char *parameter);
3767 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3768 
3769 /** @cond exclude_from_documentation */
3770 #ifndef INTEL_NO_MACRO_BODY
3771 #ifndef INTEL_NO_ITTNOTIFY_API
3772 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3773 ITT_STUB(ITTAPI, int, markA, (__itt_mark_type mt, const char    *parameter))
3774 ITT_STUB(ITTAPI, int, markW, (__itt_mark_type mt, const wchar_t *parameter))
3775 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3776 ITT_STUB(ITTAPI, int, mark,  (__itt_mark_type mt, const char *parameter))
3777 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3778 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3779 #define __itt_markA     ITTNOTIFY_DATA(markA)
3780 #define __itt_markA_ptr ITTNOTIFY_NAME(markA)
3781 #define __itt_markW     ITTNOTIFY_DATA(markW)
3782 #define __itt_markW_ptr ITTNOTIFY_NAME(markW)
3783 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3784 #define __itt_mark      ITTNOTIFY_DATA(mark)
3785 #define __itt_mark_ptr  ITTNOTIFY_NAME(mark)
3786 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3787 #else  /* INTEL_NO_ITTNOTIFY_API */
3788 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3789 #define __itt_markA(mt, parameter) (int)0
3790 #define __itt_markA_ptr 0
3791 #define __itt_markW(mt, parameter) (int)0
3792 #define __itt_markW_ptr 0
3793 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3794 #define __itt_mark(mt, parameter)  (int)0
3795 #define __itt_mark_ptr  0
3796 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3797 #endif /* INTEL_NO_ITTNOTIFY_API */
3798 #else  /* INTEL_NO_MACRO_BODY */
3799 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3800 #define __itt_markA_ptr 0
3801 #define __itt_markW_ptr 0
3802 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3803 #define __itt_mark_ptr  0
3804 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3805 #endif /* INTEL_NO_MACRO_BODY */
3806 /** @endcond */
3807 
3808 /**
3809  * @brief Use this if necessary to create a "discrete" user event type (mark) for process
3810  * rather then for one thread
3811  * @see int __itt_mark(__itt_mark_type mt, const char* parameter);
3812  */
3813 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3814 int ITTAPI __itt_mark_globalA(__itt_mark_type mt, const char    *parameter);
3815 int ITTAPI __itt_mark_globalW(__itt_mark_type mt, const wchar_t *parameter);
3816 #if defined(UNICODE) || defined(_UNICODE)
3817 #  define __itt_mark_global     __itt_mark_globalW
3818 #  define __itt_mark_global_ptr __itt_mark_globalW_ptr
3819 #else /* UNICODE  */
3820 #  define __itt_mark_global     __itt_mark_globalA
3821 #  define __itt_mark_global_ptr __itt_mark_globalA_ptr
3822 #endif /* UNICODE */
3823 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3824 int ITTAPI __itt_mark_global(__itt_mark_type mt, const char *parameter);
3825 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3826 
3827 /** @cond exclude_from_documentation */
3828 #ifndef INTEL_NO_MACRO_BODY
3829 #ifndef INTEL_NO_ITTNOTIFY_API
3830 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3831 ITT_STUB(ITTAPI, int, mark_globalA, (__itt_mark_type mt, const char    *parameter))
3832 ITT_STUB(ITTAPI, int, mark_globalW, (__itt_mark_type mt, const wchar_t *parameter))
3833 #else  /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3834 ITT_STUB(ITTAPI, int, mark_global,  (__itt_mark_type mt, const char *parameter))
3835 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3836 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3837 #define __itt_mark_globalA     ITTNOTIFY_DATA(mark_globalA)
3838 #define __itt_mark_globalA_ptr ITTNOTIFY_NAME(mark_globalA)
3839 #define __itt_mark_globalW     ITTNOTIFY_DATA(mark_globalW)
3840 #define __itt_mark_globalW_ptr ITTNOTIFY_NAME(mark_globalW)
3841 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3842 #define __itt_mark_global      ITTNOTIFY_DATA(mark_global)
3843 #define __itt_mark_global_ptr  ITTNOTIFY_NAME(mark_global)
3844 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3845 #else  /* INTEL_NO_ITTNOTIFY_API */
3846 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3847 #define __itt_mark_globalA(mt, parameter) (int)0
3848 #define __itt_mark_globalA_ptr 0
3849 #define __itt_mark_globalW(mt, parameter) (int)0
3850 #define __itt_mark_globalW_ptr 0
3851 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3852 #define __itt_mark_global(mt, parameter)  (int)0
3853 #define __itt_mark_global_ptr  0
3854 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3855 #endif /* INTEL_NO_ITTNOTIFY_API */
3856 #else  /* INTEL_NO_MACRO_BODY */
3857 #if ITT_PLATFORM==ITT_PLATFORM_WIN
3858 #define __itt_mark_globalA_ptr 0
3859 #define __itt_mark_globalW_ptr 0
3860 #else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3861 #define __itt_mark_global_ptr  0
3862 #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
3863 #endif /* INTEL_NO_MACRO_BODY */
3864 /** @endcond */
3865 
3866 /**
3867  * @brief Creates an "end" point for "continuous" mark with specified name.
3868  *
3869  * - Returns zero value in case of success, non-zero value otherwise.
3870  *   Also returns non-zero value when preceding "begin" point for the
3871  *   mark with the same name failed to be created or not created.
3872  * - The mark of "continuous" type is placed to collection results in
3873  *   case of success. It appears in overtime view(s) as a special tick
3874  *   sign (different from "discrete" mark) together with line from
3875  *   corresponding "begin" mark to "end" mark.
3876  * @note Continuous marks can overlap and be nested inside each other.
3877  * Discrete mark can be nested inside marked region
3878  * @param[in] mt - mark, created by __itt_mark_create(const char* name) function
3879  * @return Returns zero value in case of success, non-zero value otherwise.
3880  */
3881 int ITTAPI __itt_mark_off(__itt_mark_type mt);
3882 
3883 /** @cond exclude_from_documentation */
3884 #ifndef INTEL_NO_MACRO_BODY
3885 #ifndef INTEL_NO_ITTNOTIFY_API
3886 ITT_STUB(ITTAPI, int, mark_off, (__itt_mark_type mt))
3887 #define __itt_mark_off     ITTNOTIFY_DATA(mark_off)
3888 #define __itt_mark_off_ptr ITTNOTIFY_NAME(mark_off)
3889 #else  /* INTEL_NO_ITTNOTIFY_API */
3890 #define __itt_mark_off(mt) (int)0
3891 #define __itt_mark_off_ptr 0
3892 #endif /* INTEL_NO_ITTNOTIFY_API */
3893 #else  /* INTEL_NO_MACRO_BODY */
3894 #define __itt_mark_off_ptr 0
3895 #endif /* INTEL_NO_MACRO_BODY */
3896 /** @endcond */
3897 
3898 /**
3899  * @brief Use this if necessary to create an "end" point for mark of process
3900  * @see int __itt_mark_off(__itt_mark_type mt);
3901  */
3902 int ITTAPI __itt_mark_global_off(__itt_mark_type mt);
3903 
3904 /** @cond exclude_from_documentation */
3905 #ifndef INTEL_NO_MACRO_BODY
3906 #ifndef INTEL_NO_ITTNOTIFY_API
3907 ITT_STUB(ITTAPI, int, mark_global_off, (__itt_mark_type mt))
3908 #define __itt_mark_global_off     ITTNOTIFY_DATA(mark_global_off)
3909 #define __itt_mark_global_off_ptr ITTNOTIFY_NAME(mark_global_off)
3910 #else  /* INTEL_NO_ITTNOTIFY_API */
3911 #define __itt_mark_global_off(mt) (int)0
3912 #define __itt_mark_global_off_ptr 0
3913 #endif /* INTEL_NO_ITTNOTIFY_API */
3914 #else  /* INTEL_NO_MACRO_BODY */
3915 #define __itt_mark_global_off_ptr 0
3916 #endif /* INTEL_NO_MACRO_BODY */
3917 /** @endcond */
3918 /** @} marks group */
3919 
3920 /**
3921  * @defgroup counters_internal Counters
3922  * @ingroup internal
3923  * Counters group
3924  * @{
3925  */
3926 
3927 
3928 /**
3929  * @defgroup stitch Stack Stitching
3930  * @ingroup internal
3931  * Stack Stitching group
3932  * @{
3933  */
3934 /**
3935  * @brief opaque structure for counter identification
3936  */
3937 typedef struct ___itt_caller *__itt_caller;
3938 
3939 /**
3940  * @brief Create the stitch point e.g. a point in call stack where other stacks should be stitched to.
3941  * The function returns a unique identifier which is used to match the cut points with corresponding stitch points.
3942  */
3943 __itt_caller ITTAPI __itt_stack_caller_create(void);
3944 
3945 /** @cond exclude_from_documentation */
3946 #ifndef INTEL_NO_MACRO_BODY
3947 #ifndef INTEL_NO_ITTNOTIFY_API
3948 ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
3949 #define __itt_stack_caller_create     ITTNOTIFY_DATA(stack_caller_create)
3950 #define __itt_stack_caller_create_ptr ITTNOTIFY_NAME(stack_caller_create)
3951 #else  /* INTEL_NO_ITTNOTIFY_API */
3952 #define __itt_stack_caller_create() (__itt_caller)0
3953 #define __itt_stack_caller_create_ptr 0
3954 #endif /* INTEL_NO_ITTNOTIFY_API */
3955 #else  /* INTEL_NO_MACRO_BODY */
3956 #define __itt_stack_caller_create_ptr 0
3957 #endif /* INTEL_NO_MACRO_BODY */
3958 /** @endcond */
3959 
3960 /**
3961  * @brief Destroy the inforamtion about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
3962  */
3963 void ITTAPI __itt_stack_caller_destroy(__itt_caller id);
3964 
3965 /** @cond exclude_from_documentation */
3966 #ifndef INTEL_NO_MACRO_BODY
3967 #ifndef INTEL_NO_ITTNOTIFY_API
3968 ITT_STUBV(ITTAPI, void, stack_caller_destroy, (__itt_caller id))
3969 #define __itt_stack_caller_destroy     ITTNOTIFY_VOID(stack_caller_destroy)
3970 #define __itt_stack_caller_destroy_ptr ITTNOTIFY_NAME(stack_caller_destroy)
3971 #else  /* INTEL_NO_ITTNOTIFY_API */
3972 #define __itt_stack_caller_destroy(id)
3973 #define __itt_stack_caller_destroy_ptr 0
3974 #endif /* INTEL_NO_ITTNOTIFY_API */
3975 #else  /* INTEL_NO_MACRO_BODY */
3976 #define __itt_stack_caller_destroy_ptr 0
3977 #endif /* INTEL_NO_MACRO_BODY */
3978 /** @endcond */
3979 
3980 /**
3981  * @brief Sets the cut point. Stack from each event which occurs after this call will be cut
3982  * at the same stack level the function was called and stitched to the corresponding stitch point.
3983  */
3984 void ITTAPI __itt_stack_callee_enter(__itt_caller id);
3985 
3986 /** @cond exclude_from_documentation */
3987 #ifndef INTEL_NO_MACRO_BODY
3988 #ifndef INTEL_NO_ITTNOTIFY_API
3989 ITT_STUBV(ITTAPI, void, stack_callee_enter, (__itt_caller id))
3990 #define __itt_stack_callee_enter     ITTNOTIFY_VOID(stack_callee_enter)
3991 #define __itt_stack_callee_enter_ptr ITTNOTIFY_NAME(stack_callee_enter)
3992 #else  /* INTEL_NO_ITTNOTIFY_API */
3993 #define __itt_stack_callee_enter(id)
3994 #define __itt_stack_callee_enter_ptr 0
3995 #endif /* INTEL_NO_ITTNOTIFY_API */
3996 #else  /* INTEL_NO_MACRO_BODY */
3997 #define __itt_stack_callee_enter_ptr 0
3998 #endif /* INTEL_NO_MACRO_BODY */
3999 /** @endcond */
4000 
4001 /**
4002  * @brief This function eliminates the cut point which was set by latest __itt_stack_callee_enter().
4003  */
4004 void ITTAPI __itt_stack_callee_leave(__itt_caller id);
4005 
4006 /** @cond exclude_from_documentation */
4007 #ifndef INTEL_NO_MACRO_BODY
4008 #ifndef INTEL_NO_ITTNOTIFY_API
4009 ITT_STUBV(ITTAPI, void, stack_callee_leave, (__itt_caller id))
4010 #define __itt_stack_callee_leave     ITTNOTIFY_VOID(stack_callee_leave)
4011 #define __itt_stack_callee_leave_ptr ITTNOTIFY_NAME(stack_callee_leave)
4012 #else  /* INTEL_NO_ITTNOTIFY_API */
4013 #define __itt_stack_callee_leave(id)
4014 #define __itt_stack_callee_leave_ptr 0
4015 #endif /* INTEL_NO_ITTNOTIFY_API */
4016 #else  /* INTEL_NO_MACRO_BODY */
4017 #define __itt_stack_callee_leave_ptr 0
4018 #endif /* INTEL_NO_MACRO_BODY */
4019 /** @endcond */
4020 
4021 /** @} stitch group */
4022 
4023 /* ***************************************************************************************************************************** */
4024 
4025 #include <stdarg.h>
4026 
4027 /** @cond exclude_from_documentation */
4028 typedef enum __itt_error_code
4029 {
4030     __itt_error_success       = 0, /*!< no error */
4031     __itt_error_no_module     = 1, /*!< module can't be loaded */
4032     /* %1$s -- library name; win: %2$d -- system error code; unx: %2$s -- system error message. */
4033     __itt_error_no_symbol     = 2, /*!< symbol not found */
4034     /* %1$s -- library name, %2$s -- symbol name. */
4035     __itt_error_unknown_group = 3, /*!< unknown group specified */
4036     /* %1$s -- env var name, %2$s -- group name. */
4037     __itt_error_cant_read_env = 4, /*!< GetEnvironmentVariable() failed */
4038     /* %1$s -- env var name, %2$d -- system error. */
4039     __itt_error_env_too_long  = 5, /*!< variable value too long */
4040     /* %1$s -- env var name, %2$d -- actual length of the var, %3$d -- max allowed length. */
4041     __itt_error_system        = 6  /*!< pthread_mutexattr_init or pthread_mutex_init failed */
4042     /* %1$s -- function name, %2$d -- errno. */
4043 } __itt_error_code;
4044 
4045 typedef void (__itt_error_handler_t)(__itt_error_code code, va_list);
4046 __itt_error_handler_t* __itt_set_error_handler(__itt_error_handler_t*);
4047 
4048 const char* ITTAPI __itt_api_version(void);
4049 /** @endcond */
4050 
4051 /** @cond exclude_from_documentation */
4052 #ifndef INTEL_NO_MACRO_BODY
4053 #ifndef INTEL_NO_ITTNOTIFY_API
4054 #define __itt_error_handler ITT_JOIN(INTEL_ITTNOTIFY_PREFIX, error_handler)
4055 void __itt_error_handler(__itt_error_code code, va_list args);
4056 extern const int ITTNOTIFY_NAME(err);
4057 #define __itt_err ITTNOTIFY_NAME(err)
4058 ITT_STUB(ITTAPI, const char*, api_version, (void))
4059 #define __itt_api_version     ITTNOTIFY_DATA(api_version)
4060 #define __itt_api_version_ptr ITTNOTIFY_NAME(api_version)
4061 #else  /* INTEL_NO_ITTNOTIFY_API */
4062 #define __itt_api_version()   (const char*)0
4063 #define __itt_api_version_ptr 0
4064 #endif /* INTEL_NO_ITTNOTIFY_API */
4065 #else  /* INTEL_NO_MACRO_BODY */
4066 #define __itt_api_version_ptr 0
4067 #endif /* INTEL_NO_MACRO_BODY */
4068 /** @endcond */
4069 
4070 #ifdef __cplusplus
4071 }
4072 #endif /* __cplusplus */
4073 
4074 #endif /* _ITTNOTIFY_PRIVATE_ */
4075 
4076 #endif /* INTEL_ITTNOTIFY_API_PRIVATE */
4077