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