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