VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
itt.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
11 
13 
14 #include "vrfutil/vrfutilDefines.h"
15 
16 #ifdef USE_VTUNE_ITT_API
17  #include <ittnotify.h>
18 
20  extern DT_DLL_vrfutil const bool theITTEnabledFlag;
21 #else
22 
23  typedef void __itt_domain;
24  typedef void __itt_string_handle;
25 
26  struct __itt_id { };
27 
28  #define __itt_null __itt_id()
29 #endif
30 
36  template <typename Char>
37  inline void Dt__itt_thread_set_name(const Char* name)
38  {
39 #ifdef USE_VTUNE_ITT_API
40  if (theITTEnabledFlag)
41  {
42  __itt_thread_set_name(name);
43  }
44 #endif
45  }
46 
47  template <typename Char>
48  inline __itt_domain* Dt__itt_domain_create(const Char* name)
49  {
50 #ifdef USE_VTUNE_ITT_API
51  if (theITTEnabledFlag)
52  {
53  return __itt_domain_create(name);
54  }
55 #endif
56 
57  return 0;
58  }
59 
60  template <typename Char>
62  {
63 #ifdef USE_VTUNE_ITT_API
64  if (theITTEnabledFlag)
65  {
66  return __itt_string_handle_create(name);
67  }
68 #endif
69 
70  return 0;
71  }
72 
73  inline void Dt__itt_frame_begin_v3(const __itt_domain* domain, __itt_id* id)
74  {
75 #ifdef USE_VTUNE_ITT_API
76  if (theITTEnabledFlag)
77  {
78  __itt_frame_begin_v3(domain, id);
79  }
80 #endif
81  }
82 
83  inline void Dt__itt_frame_end_v3(const __itt_domain* domain, __itt_id* id)
84  {
85 #ifdef USE_VTUNE_ITT_API
86  if (theITTEnabledFlag)
87  {
88  __itt_frame_end_v3(domain, id);
89  }
90 #endif
91  }
92 
93  inline void Dt__itt_task_begin(
94  const __itt_domain* domain, __itt_id id, __itt_id parent, __itt_string_handle* name)
95  {
96 #ifdef USE_VTUNE_ITT_API
97  if (theITTEnabledFlag)
98  {
99  __itt_task_begin(domain, id, parent, name);
100  }
101 #endif
102  }
103 
104  inline void Dt__itt_task_end(const __itt_domain* domain)
105  {
106 #ifdef USE_VTUNE_ITT_API
107  if (theITTEnabledFlag)
108  {
109  __itt_task_end(domain);
110  }
111 #endif
112  }
114 
116  class DtITTTask
117  {
118  public:
120  : domain(domain)
121  {
123  }
124 
126  {
128  }
129 
130  private:
132  };
133 
135 #define DtVRF_ITT_PROFILE(domain, name) DtITTTask _itt_profile_node##__LINE__(domain, name);

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)