ittnotify.h 192 KB

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