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