<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> <meta http-equiv="X-UA-Compatible" content="IE=edge"></meta> <meta name="copyright" content="(C) Copyright 2005"></meta> <meta name="DC.rights.owner" content="(C) Copyright 2005"></meta> <meta name="DC.Type" content="cppModule"></meta> <meta name="DC.Title" content="CUPTI Callback API"></meta> <meta name="abstract" content=""></meta> <meta name="description" content=""></meta> <meta name="DC.Format" content="XHTML"></meta> <meta name="DC.Identifier" content="group__CUPTI__CALLBACK__API"></meta> <link rel="stylesheet" type="text/css" href="../common/formatting/commonltr.css"></link> <link rel="stylesheet" type="text/css" href="../common/formatting/site.css"></link> <title>CUPTI :: CUDA Toolkit Documentation</title> <!--[if lt IE 9]> <script src="../common/formatting/html5shiv-printshiv.min.js"></script> <![endif]--> <script type="text/javascript" charset="utf-8" src="../common/scripts/tynt/tynt.js"></script> <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.min.js"></script> <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.ba-hashchange.min.js"></script> <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.scrollintoview.min.js"></script> <script type="text/javascript" src="../search/htmlFileList.js"></script> <script type="text/javascript" src="../search/htmlFileInfoList.js"></script> <script type="text/javascript" src="../search/nwSearchFnt.min.js"></script> <script type="text/javascript" src="../search/stemmers/en_stemmer.min.js"></script> <script type="text/javascript" src="../search/index-1.js"></script> <script type="text/javascript" src="../search/index-2.js"></script> <script type="text/javascript" src="../search/index-3.js"></script> <link rel="canonical" href="http://docs.nvidia.com/cuda/cupti/index.html"></link> <link rel="stylesheet" type="text/css" href="../common/formatting/qwcode.highlight.css"></link> </head> <body> <header id="header"><span id="company">NVIDIA</span><span id="site-title">CUDA Toolkit Documentation</span><form id="search" method="get" action="search"> <input type="text" name="search-text"></input><fieldset id="search-location"> <legend>Search In:</legend> <label><input type="radio" name="search-type" value="site"></input>Entire Site</label> <label><input type="radio" name="search-type" value="document"></input>Just This Document</label></fieldset> <button type="reset">clear search</button> <button id="submit" type="submit">search</button></form> </header> <div id="site-content"> <nav id="site-nav"> <div class="category closed"><a href="../index.html" title="The root of the site.">CUDA Toolkit v6.5</a></div> <div class="category"><a href="index.html" title="CUPTI">CUPTI</a></div> <ul> <li> <div class="section-link"><a href="r_main.html#r_main">1. Usage</a></div> <ul> <li> <div class="section-link"><a href="r_main.html#r_compatibility_requirements">1.1. CUPTI Compatibility and Requirements</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_initialization">1.2. CUPTI Initialization</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_activity">1.3. CUPTI Activity API</a></div> <ul> <li> <div class="section-link"><a href="r_main.html#r_context_activity">1.3.1. Context Activity Record</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_legacy_activity">1.3.2. Legacy Activity Records</a></div> </li> </ul> </li> <li> <div class="section-link"><a href="r_main.html#r_callback_api">1.4. CUPTI Callback API</a></div> <ul> <li> <div class="section-link"><a href="r_main.html#r_driver_runtime_api_callback">1.4.1. Driver and Runtime API Callbacks</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_resource_callbacks">1.4.2. Resource Callbacks</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_synchronization_callbacks">1.4.3. Synchronization Callbacks</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_nvtx_callbacks">1.4.4. NVIDIA Tools Extension Callbacks</a></div> </li> </ul> </li> <li> <div class="section-link"><a href="r_main.html#r_event_api">1.5. CUPTI Event API</a></div> <ul> <li> <div class="section-link"><a href="r_main.html#r_collecting_kernel_execution_events">1.5.1. Collecting Kernel Execution Events</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_sampling_events">1.5.2. Sampling Events</a></div> </li> </ul> </li> <li> <div class="section-link"><a href="r_main.html#r_metric_api">1.6. CUPTI Metric API</a></div> </li> <li> <div class="section-link"><a href="r_main.html#r_samples">1.7. Samples</a></div> </li> </ul> </li> <li> <div class="section-link"><a href="modules.html#modules">2. Modules</a></div> <ul> <li> <div class="section-link"><a href="group__CUPTI__VERSION__API.html#group__CUPTI__VERSION__API">2.1. CUPTI Version</a></div> </li> <li> <div class="section-link"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API">2.2. CUPTI Result Codes</a></div> </li> <li> <div class="section-link"><a href="group__CUPTI__ACTIVITY__API.html#group__CUPTI__ACTIVITY__API">2.3. CUPTI Activity API</a></div> </li> <li> <div class="section-link"><a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API">2.4. CUPTI Callback API</a></div> </li> <li> <div class="section-link"><a href="group__CUPTI__EVENT__API.html#group__CUPTI__EVENT__API">2.5. CUPTI Event API</a></div> </li> <li> <div class="section-link"><a href="group__CUPTI__METRIC__API.html#group__CUPTI__METRIC__API">2.6. CUPTI Metric API</a></div> </li> </ul> </li> <li> <div class="section-link"><a href="annotated.html#annotated">3. Data Structures</a></div> <ul> <li> <div class="section-link"><a href="structCUpti__Activity.html#structCUpti__Activity">3.1. CUpti_Activity</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityAPI.html#structCUpti__ActivityAPI">3.2. CUpti_ActivityAPI</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityAutoBoostState.html#structCUpti__ActivityAutoBoostState">3.3. CUpti_ActivityAutoBoostState</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityBranch.html#structCUpti__ActivityBranch">3.4. CUpti_ActivityBranch</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityBranch2.html#structCUpti__ActivityBranch2">3.5. CUpti_ActivityBranch2</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityCdpKernel.html#structCUpti__ActivityCdpKernel">3.6. CUpti_ActivityCdpKernel</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityContext.html#structCUpti__ActivityContext">3.7. CUpti_ActivityContext</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityDevice.html#structCUpti__ActivityDevice">3.8. CUpti_ActivityDevice</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityDeviceAttribute.html#structCUpti__ActivityDeviceAttribute">3.9. CUpti_ActivityDeviceAttribute</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityEnvironment.html#structCUpti__ActivityEnvironment">3.10. CUpti_ActivityEnvironment</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityEvent.html#structCUpti__ActivityEvent">3.11. CUpti_ActivityEvent</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityEventInstance.html#structCUpti__ActivityEventInstance">3.12. CUpti_ActivityEventInstance</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityFunction.html#structCUpti__ActivityFunction">3.13. CUpti_ActivityFunction</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityGlobalAccess.html#structCUpti__ActivityGlobalAccess">3.14. CUpti_ActivityGlobalAccess</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityGlobalAccess2.html#structCUpti__ActivityGlobalAccess2">3.15. CUpti_ActivityGlobalAccess2</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityInstructionExecution.html#structCUpti__ActivityInstructionExecution">3.16. CUpti_ActivityInstructionExecution</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityKernel.html#structCUpti__ActivityKernel">3.17. CUpti_ActivityKernel</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityKernel2.html#structCUpti__ActivityKernel2">3.18. CUpti_ActivityKernel2</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityMarker.html#structCUpti__ActivityMarker">3.19. CUpti_ActivityMarker</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityMarkerData.html#structCUpti__ActivityMarkerData">3.20. CUpti_ActivityMarkerData</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityMemcpy.html#structCUpti__ActivityMemcpy">3.21. CUpti_ActivityMemcpy</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityMemcpy2.html#structCUpti__ActivityMemcpy2">3.22. CUpti_ActivityMemcpy2</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityMemset.html#structCUpti__ActivityMemset">3.23. CUpti_ActivityMemset</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityMetric.html#structCUpti__ActivityMetric">3.24. CUpti_ActivityMetric</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityMetricInstance.html#structCUpti__ActivityMetricInstance">3.25. CUpti_ActivityMetricInstance</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityModule.html#structCUpti__ActivityModule">3.26. CUpti_ActivityModule</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityName.html#structCUpti__ActivityName">3.27. CUpti_ActivityName</a></div> </li> <li> <div class="section-link"><a href="unionCUpti__ActivityObjectKindId.html#unionCUpti__ActivityObjectKindId">3.28. CUpti_ActivityObjectKindId</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityOverhead.html#structCUpti__ActivityOverhead">3.29. CUpti_ActivityOverhead</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityPreemption.html#structCUpti__ActivityPreemption">3.30. CUpti_ActivityPreemption</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivitySharedAccess.html#structCUpti__ActivitySharedAccess">3.31. CUpti_ActivitySharedAccess</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivitySourceLocator.html#structCUpti__ActivitySourceLocator">3.32. CUpti_ActivitySourceLocator</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityUnifiedMemoryCounter.html#structCUpti__ActivityUnifiedMemoryCounter">3.33. CUpti_ActivityUnifiedMemoryCounter</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ActivityUnifiedMemoryCounterConfig.html#structCUpti__ActivityUnifiedMemoryCounterConfig">3.34. CUpti_ActivityUnifiedMemoryCounterConfig</a></div> </li> <li> <div class="section-link"><a href="structCUpti__CallbackData.html#structCUpti__CallbackData">3.35. CUpti_CallbackData</a></div> </li> <li> <div class="section-link"><a href="structCUpti__EventGroupSet.html#structCUpti__EventGroupSet">3.36. CUpti_EventGroupSet</a></div> </li> <li> <div class="section-link"><a href="structCUpti__EventGroupSets.html#structCUpti__EventGroupSets">3.37. CUpti_EventGroupSets</a></div> </li> <li> <div class="section-link"><a href="unionCUpti__MetricValue.html#unionCUpti__MetricValue">3.38. CUpti_MetricValue</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ModuleResourceData.html#structCUpti__ModuleResourceData">3.39. CUpti_ModuleResourceData</a></div> </li> <li> <div class="section-link"><a href="structCUpti__NvtxData.html#structCUpti__NvtxData">3.40. CUpti_NvtxData</a></div> </li> <li> <div class="section-link"><a href="structCUpti__ResourceData.html#structCUpti__ResourceData">3.41. CUpti_ResourceData</a></div> </li> <li> <div class="section-link"><a href="structCUpti__SynchronizeData.html#structCUpti__SynchronizeData">3.42. CUpti_SynchronizeData</a></div> </li> </ul> </li> <li> <div class="section-link"><a href="functions.html#functions">4. Data Fields</a></div> </li> <li> <div class="section-link"><a href="notices-header.html#notices-header">Notices</a></div> <ul></ul> </li> </ul> </nav> <div id="resize-nav"></div> <nav id="search-results"> <h2>Search Results</h2> <ol></ol> </nav> <div id="contents-container"> <div id="breadcrumbs-container"> <div id="breadcrumbs"><a href="group__CUPTI__ACTIVITY__API.html" shape="rect">< Previous</a> | <a href="group__CUPTI__EVENT__API.html" shape="rect">Next ></a></div> <div id="release-info">CUPTI (<a href="../../pdf/CUPTI_Library.pdf">PDF</a>) - v6.5 (<a href="https://developer.nvidia.com/cuda-toolkit-archive">older</a>) - Last updated August 1, 2014 - <a href="mailto:cudatools@nvidia.com?subject=CUDA Toolkit Documentation Feedback: CUPTI">Send Feedback</a> - <span class="st_facebook"></span><span class="st_twitter"></span><span class="st_linkedin"></span><span class="st_reddit"></span><span class="st_slashdot"></span><span class="st_tumblr"></span><span class="st_sharethis"></span></div> </div> <article id="contents"> <div class="topic reference apiRef apiPackage cppModule" id="group__CUPTI__CALLBACK__API"><a name="group__CUPTI__CALLBACK__API" shape="rect"> <!-- --></a><h2 class="topictitle2 cppModule">2.4. CUPTI Callback API</h2> <div class="section"> <p>Functions, types, and enums that implement the CUPTI Callback API. </p> </div> <h3 class="fake_sectiontitle member_header">Classes</h3> <dl class="members"> <dt><span class="member_type">struct </span><span class="member_name"> <div><a class="link" href="structCUpti__CallbackData.html#structCUpti__CallbackData" title="Data passed into a runtime or driver API callback function." shape="rect">CUpti_CallbackData</a></div></span></dt> <dd class="shortdesc"><span></span><span class="desc">Data passed into a runtime or driver API callback function. </span><a href="structCUpti__CallbackData.html#structCUpti__CallbackData" class="link" title="Data passed into a runtime or driver API callback function." shape="rect"></a></dd> <dt><span class="member_type">struct </span><span class="member_name"> <div><a class="link" href="structCUpti__ModuleResourceData.html#structCUpti__ModuleResourceData" title="Module data passed into a resource callback function." shape="rect">CUpti_ModuleResourceData</a></div></span></dt> <dd class="shortdesc"><span></span><span class="desc">Module data passed into a resource callback function. </span><a href="structCUpti__ModuleResourceData.html#structCUpti__ModuleResourceData" class="link" title="Module data passed into a resource callback function." shape="rect"></a></dd> <dt><span class="member_type">struct </span><span class="member_name"> <div><a class="link" href="structCUpti__NvtxData.html#structCUpti__NvtxData" title="Data passed into a NVTX callback function." shape="rect">CUpti_NvtxData</a></div></span></dt> <dd class="shortdesc"><span></span><span class="desc">Data passed into a NVTX callback function. </span><a href="structCUpti__NvtxData.html#structCUpti__NvtxData" class="link" title="Data passed into a NVTX callback function." shape="rect"></a></dd> <dt><span class="member_type">struct </span><span class="member_name"> <div><a class="link" href="structCUpti__ResourceData.html#structCUpti__ResourceData" title="Data passed into a resource callback function." shape="rect">CUpti_ResourceData</a></div></span></dt> <dd class="shortdesc"><span></span><span class="desc">Data passed into a resource callback function. </span><a href="structCUpti__ResourceData.html#structCUpti__ResourceData" class="link" title="Data passed into a resource callback function." shape="rect"></a></dd> <dt><span class="member_type">struct </span><span class="member_name"> <div><a class="link" href="structCUpti__SynchronizeData.html#structCUpti__SynchronizeData" title="Data passed into a synchronize callback function." shape="rect">CUpti_SynchronizeData</a></div></span></dt> <dd class="shortdesc"><span></span><span class="desc">Data passed into a synchronize callback function. </span><a href="structCUpti__SynchronizeData.html#structCUpti__SynchronizeData" class="link" title="Data passed into a synchronize callback function." shape="rect"></a></dd> </dl> <h3 class="fake_sectiontitle member_header">Typedefs</h3> <dl class="members"> <dt><span class="member_type">typedef void </span><span class="member_name">( *<a href="#group__CUPTI__CALLBACK__API_1g84b7295694fda2bbfda931682a07bf4f" shape="rect">CUpti_CallbackFunc</a> )( void* <span> </span><span class="keyword keyword apiItemName">userdata</span>, <span> </span><span class="keyword keyword apiItemName">CUpti_CallbackDomain domain</span>, <span> </span><span class="keyword keyword apiItemName">CUpti_CallbackId cbid</span>, const void* <span> </span><span class="keyword keyword apiItemName">cbdata</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Function type for a callback. </span></dd> <dt><span class="member_type">typedef uint32_t </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g7fde6b76bdbcafbcf750b0f91a3484f8" shape="rect">CUpti_CallbackId</a></span></dt> <dd class="shortdesc"><span></span><span class="desc">An ID for a driver API, runtime API, resource or synchronization callback. </span></dd> <dt><span class="member_long_type">typedef <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain*</a> </span><span class="member_name_long_type"><a href="#group__CUPTI__CALLBACK__API_1g76b7ef0d7caebdcae0880e218185950b" shape="rect">CUpti_DomainTable</a></span></dt> <dd class="shortdesc"><span></span><span class="desc">Pointer to an array of callback domains. </span></dd> <dt><span class="member_long_type">typedef CUpti_Subscriber_st * </span><span class="member_name_long_type"><a href="#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" shape="rect">CUpti_SubscriberHandle</a></span></dt> <dd class="shortdesc"><span></span><span class="desc">A callback subscriber. </span></dd> </dl> <h3 class="fake_sectiontitle member_header">Enumerations</h3> <dl class="members"> <dt><span class="member_type">enum </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g7bd557c9b3084014c680b9925842be24" shape="rect">CUpti_ApiCallbackSite</a></span></dt> <dd class="shortdesc"><span></span><span class="desc">Specifies the point in an API call that a callback is issued. </span></dd> <dt><span class="member_type">enum </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" shape="rect">CUpti_CallbackDomain</a></span></dt> <dd class="shortdesc"><span></span><span class="desc">Callback domains. </span></dd> <dt><span class="member_type">enum </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g690fb2a42aefe39f00033c957ce211b2" shape="rect">CUpti_CallbackIdResource</a></span></dt> <dd class="shortdesc"><span></span><span class="desc">Callback IDs for resource domain. </span></dd> <dt><span class="member_type">enum </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1gcaeba9950bf4f48ea7ab9a0402dc7e6f" shape="rect">CUpti_CallbackIdSync</a></span></dt> <dd class="shortdesc"><span></span><span class="desc">Callback IDs for synchronization domain. </span></dd> </dl> <h3 class="fake_sectiontitle member_header">Functions</h3> <dl class="members"> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g7dcebeb8ae4f79c90905a8f6befc51d7" shape="rect">cuptiEnableAllDomains</a> ( uint32_t<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Enable or disable all callbacks in all domains. </span></dd> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1gce619a64b77d6533754de798b5e8263e" shape="rect">cuptiEnableCallback</a> ( uint32_t<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7fde6b76bdbcafbcf750b0f91a3484f8" title="An ID for a driver API, runtime API, resource or synchronization callback. " shape="rect">CUpti_CallbackId</a><span> </span><span class="keyword keyword apiItemName">cbid</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Enable or disabled callbacks for a specific domain and callback ID. </span></dd> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g926699208431270d4197fcb639da6a5c" shape="rect">cuptiEnableDomain</a> ( uint32_t<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Enable or disabled all callbacks for a specific domain. </span></dd> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g0fe2357995aa7861a37e5896c6a18635" shape="rect">cuptiGetCallbackName</a> ( <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span>, uint32_t<span> </span><span class="keyword keyword apiItemName">cbid</span>, const char**<span> </span><span class="keyword keyword apiItemName">name</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Get the name of a callback for a specific domain and callback ID. </span></dd> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1gf861e55f8d61286b97471e2bede138a6" shape="rect">cuptiGetCallbackState</a> ( uint32_t*<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7fde6b76bdbcafbcf750b0f91a3484f8" title="An ID for a driver API, runtime API, resource or synchronization callback. " shape="rect">CUpti_CallbackId</a><span> </span><span class="keyword keyword apiItemName">cbid</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Get the current enabled/disabled state of a callback for a specific domain and function ID. </span></dd> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1gd2c32850b2e03b37e284df083dc9053f" shape="rect">cuptiSubscribe</a> ( <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a>*<span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g84b7295694fda2bbfda931682a07bf4f" title="Function type for a callback. " shape="rect">CUpti_CallbackFunc</a><span> </span><span class="keyword keyword apiItemName">callback</span>, void*<span> </span><span class="keyword keyword apiItemName">userdata</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Initialize a callback subscriber with a callback function and user data. </span></dd> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g4526fa1776292fa325971e815e0c7dc2" shape="rect">cuptiSupportedDomains</a> ( size_t*<span> </span><span class="keyword keyword apiItemName">domainCount</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_DomainTable</a>*<span> </span><span class="keyword keyword apiItemName">domainTable</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Get the available callback domains. </span></dd> <dt><span class="member_type"><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> </span><span class="member_name"><a href="#group__CUPTI__CALLBACK__API_1g20b68c9c33f129179b56687a17356682" shape="rect">cuptiUnsubscribe</a> ( <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span> ) </span></dt> <dd class="shortdesc"><span></span><span class="desc">Unregister a callback subscriber. </span></dd> </dl> <div class="description"> <h3 class="sectiontitle">Typedefs</h3> <dl class="description"> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g84b7295694fda2bbfda931682a07bf4f" id="group__CUPTI__CALLBACK__API_1g84b7295694fda2bbfda931682a07bf4f" shape="rect"> <!-- --></a><span> void ( *CUpti_CallbackFunc )( void* <span> </span><span class="keyword keyword apiItemName">userdata</span>, <span> </span><span class="keyword keyword apiItemName">CUpti_CallbackDomain domain</span>, <span> </span><span class="keyword keyword apiItemName">CUpti_CallbackId cbid</span>, const void* <span> </span><span class="keyword keyword apiItemName">cbdata</span> ) </span></dt> <dd class="description"> <div class="section"> <p>Function type for a callback. Function type for a callback. The type of the data passed to the callback in <tt class="ph tt code">cbdata</tt> depends on the <tt class="ph tt code">domain</tt>. If <tt class="ph tt code">domain</tt> is CUPTI_CB_DOMAIN_DRIVER_API or CUPTI_CB_DOMAIN_RUNTIME_API the type of <tt class="ph tt code">cbdata</tt> will be <a class="xref" href="structCUpti__CallbackData.html#structCUpti__CallbackData" title="Data passed into a runtime or driver API callback function." shape="rect">CUpti_CallbackData</a>. If <tt class="ph tt code">domain</tt> is CUPTI_CB_DOMAIN_RESOURCE the type of <tt class="ph tt code">cbdata</tt> will be <a class="xref" href="structCUpti__ResourceData.html#structCUpti__ResourceData" title="Data passed into a resource callback function." shape="rect">CUpti_ResourceData</a>. If <tt class="ph tt code">domain</tt> is CUPTI_CB_DOMAIN_SYNCHRONIZE the type of <tt class="ph tt code">cbdata</tt> will be <a class="xref" href="structCUpti__SynchronizeData.html#structCUpti__SynchronizeData" title="Data passed into a synchronize callback function." shape="rect">CUpti_SynchronizeData</a>. If <tt class="ph tt code">domain</tt> is CUPTI_CB_DOMAIN_NVTX the type of <tt class="ph tt code">cbdata</tt> will be <a class="xref" href="structCUpti__NvtxData.html#structCUpti__NvtxData" title="Data passed into a NVTX callback function." shape="rect">CUpti_NvtxData</a>. </p> <p class="p"></p> </div> </dd> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">userdata</span></tt></dt> <dd>User data supplied at subscription of the callback </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">CUpti_CallbackDomain domain</span></tt></dt> <dd></dd> <dt><tt class="code"><span class="keyword keyword apiItemName">CUpti_CallbackId cbid</span></tt></dt> <dd></dd> <dt><tt class="code"><span class="keyword keyword apiItemName">cbdata</span></tt></dt> <dd>Data passed to the callback. </dd> </dl> </div> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g7fde6b76bdbcafbcf750b0f91a3484f8" id="group__CUPTI__CALLBACK__API_1g7fde6b76bdbcafbcf750b0f91a3484f8" shape="rect"> <!-- --></a><span>typedef uint32_t CUpti_CallbackId</span></dt> <dd class="description"> <div class="section"> <p>An ID for a driver API, runtime API, resource or synchronization callback. An ID for a driver API, runtime API, resource or synchronization callback. Within a driver API callback this should be interpreted as a CUpti_driver_api_trace_cbid value (these values are defined in cupti_driver_cbid.h). Within a runtime API callback this should be interpreted as a CUpti_runtime_api_trace_cbid value (these values are defined in cupti_runtime_cbid.h). Within a resource API callback this should be interpreted as a <a class="xref" href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g690fb2a42aefe39f00033c957ce211b2" title="Callback IDs for resource domain." shape="rect">CUpti_CallbackIdResource</a> value. Within a synchronize API callback this should be interpreted as a <a class="xref" href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1gcaeba9950bf4f48ea7ab9a0402dc7e6f" title="Callback IDs for synchronization domain." shape="rect">CUpti_CallbackIdSync</a> value. </p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g76b7ef0d7caebdcae0880e218185950b" id="group__CUPTI__CALLBACK__API_1g76b7ef0d7caebdcae0880e218185950b" shape="rect"> <!-- --></a><span>typedef <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain*</a> CUpti_DomainTable</span></dt> <dd class="description"> <div class="section"> <p>Pointer to an array of callback domains. </p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" id="group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" shape="rect"> <!-- --></a><span>typedef CUpti_Subscriber_st * CUpti_SubscriberHandle</span></dt> <dd class="description"> <div class="section"> <p>A callback subscriber. </p> </div> </dd> </dl> </div> <div class="description"> <h3 class="sectiontitle">Enumerations</h3> <dl class="description"> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g7bd557c9b3084014c680b9925842be24" id="group__CUPTI__CALLBACK__API_1g7bd557c9b3084014c680b9925842be24" shape="rect"> <!-- --></a><span>enum CUpti_ApiCallbackSite</span></dt> <dd class="description"> <div class="section"> <p>Specifies the point in an API call that a callback is issued. This value is communicated to the callback function via <a class="xref" href="structCUpti__CallbackData.html#structCUpti__CallbackData_101337ce329bea0e08d803cb99c1f1f01" shape="rect">CUpti_CallbackData::callbackSite</a>. </p> </div> <div class="enum-members"> <h6 class="enumerator_header"> Values </h6> <dl class="enumerator"> <dt><span class="enum-member-name-def">CUPTI_API_ENTER = <span class="ph ph apiData">0</span></span></dt> <dd>The callback is at the entry of the API call. </dd> <dt><span class="enum-member-name-def">CUPTI_API_EXIT = <span class="ph ph apiData">1</span></span></dt> <dd>The callback is at the exit of the API call. </dd> <dt><span class="enum-member-name-def">CUPTI_API_CBSITE_FORCE_INT = <span class="ph ph apiData">0x7fffffff</span></span></dt> <dd></dd> </dl> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" id="group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" shape="rect"> <!-- --></a><span>enum CUpti_CallbackDomain</span></dt> <dd class="description"> <div class="section"> <p>Callback domains. Each domain represents callback points for a group of related API functions or CUDA driver activity. </p> </div> <div class="enum-members"> <h6 class="enumerator_header"> Values </h6> <dl class="enumerator"> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_INVALID = <span class="ph ph apiData">0</span></span></dt> <dd>Invalid domain. </dd> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_DRIVER_API = <span class="ph ph apiData">1</span></span></dt> <dd>Domain containing callback points for all driver API functions. </dd> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_RUNTIME_API = <span class="ph ph apiData">2</span></span></dt> <dd>Domain containing callback points for all runtime API functions. </dd> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_RESOURCE = <span class="ph ph apiData">3</span></span></dt> <dd>Domain containing callback points for CUDA resource tracking. </dd> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_SYNCHRONIZE = <span class="ph ph apiData">4</span></span></dt> <dd>Domain containing callback points for CUDA synchronization. </dd> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_NVTX = <span class="ph ph apiData">5</span></span></dt> <dd>Domain containing callback points for NVTX API functions. </dd> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_SIZE = <span class="ph ph apiData">6</span></span></dt> <dd></dd> <dt><span class="enum-member-name-def">CUPTI_CB_DOMAIN_FORCE_INT = <span class="ph ph apiData">0x7fffffff</span></span></dt> <dd></dd> </dl> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g690fb2a42aefe39f00033c957ce211b2" id="group__CUPTI__CALLBACK__API_1g690fb2a42aefe39f00033c957ce211b2" shape="rect"> <!-- --></a><span>enum CUpti_CallbackIdResource</span></dt> <dd class="description"> <div class="section"> <p>Callback IDs for resource domain, CUPTI_CB_DOMAIN_RESOURCE. This value is communicated to the callback function via the <tt class="ph tt code">cbid</tt> parameter. </p> </div> <div class="enum-members"> <h6 class="enumerator_header"> Values </h6> <dl class="enumerator"> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_INVALID = <span class="ph ph apiData">0</span></span></dt> <dd>Invalid resource callback ID. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_CONTEXT_CREATED = <span class="ph ph apiData">1</span></span></dt> <dd>A new context has been created. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_CONTEXT_DESTROY_STARTING = <span class="ph ph apiData">2</span></span></dt> <dd>A context is about to be destroyed. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_STREAM_CREATED = <span class="ph ph apiData">3</span></span></dt> <dd>A new stream has been created. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_STREAM_DESTROY_STARTING = <span class="ph ph apiData">4</span></span></dt> <dd>A stream is about to be destroyed. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_CU_INIT_FINISHED = <span class="ph ph apiData">5</span></span></dt> <dd>The driver has finished initializing. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_MODULE_LOADED = <span class="ph ph apiData">6</span></span></dt> <dd>A module has been loaded. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_MODULE_UNLOAD_STARTING = <span class="ph ph apiData">7</span></span></dt> <dd>A module is about to be unloaded. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_MODULE_PROFILED = <span class="ph ph apiData">8</span></span></dt> <dd>The current module which is being profiled. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_SIZE</span></dt> <dd></dd> <dt><span class="enum-member-name-def">CUPTI_CBID_RESOURCE_FORCE_INT = <span class="ph ph apiData">0x7fffffff</span></span></dt> <dd></dd> </dl> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1gcaeba9950bf4f48ea7ab9a0402dc7e6f" id="group__CUPTI__CALLBACK__API_1gcaeba9950bf4f48ea7ab9a0402dc7e6f" shape="rect"> <!-- --></a><span>enum CUpti_CallbackIdSync</span></dt> <dd class="description"> <div class="section"> <p>Callback IDs for synchronization domain, CUPTI_CB_DOMAIN_SYNCHRONIZE. This value is communicated to the callback function via the <tt class="ph tt code">cbid</tt> parameter. </p> </div> <div class="enum-members"> <h6 class="enumerator_header"> Values </h6> <dl class="enumerator"> <dt><span class="enum-member-name-def">CUPTI_CBID_SYNCHRONIZE_INVALID = <span class="ph ph apiData">0</span></span></dt> <dd>Invalid synchronize callback ID. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_SYNCHRONIZE_STREAM_SYNCHRONIZED = <span class="ph ph apiData">1</span></span></dt> <dd>Stream synchronization has completed for the stream. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_SYNCHRONIZE_CONTEXT_SYNCHRONIZED = <span class="ph ph apiData">2</span></span></dt> <dd>Context synchronization has completed for the context. </dd> <dt><span class="enum-member-name-def">CUPTI_CBID_SYNCHRONIZE_SIZE</span></dt> <dd></dd> <dt><span class="enum-member-name-def">CUPTI_CBID_SYNCHRONIZE_FORCE_INT = <span class="ph ph apiData">0x7fffffff</span></span></dt> <dd></dd> </dl> </div> </dd> </dl> </div> <div class="description"> <h3 class="sectiontitle">Functions</h3> <dl class="description"> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g7dcebeb8ae4f79c90905a8f6befc51d7" id="group__CUPTI__CALLBACK__API_1g7dcebeb8ae4f79c90905a8f6befc51d7" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiEnableAllDomains ( uint32_t<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span> ) </span></dt> <dd class="description"> <div class="section">Enable or disable all callbacks in all domains. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">enable</span></tt></dt> <dd>New enable state for all callbacks in all domain. Zero disables all callbacks, non-zero enables all callbacks. </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">subscriber</span></tt></dt> <dd>- Handle to callback subscription</dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_NOT_INITIALIZED <p class="p">if unable to initialized CUPTI </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">subscriber</tt> is invalid </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Enable or disable all callbacks in all domains.</p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><p class="p"><strong class="ph b">Thread-safety</strong>: a subscriber must serialize access to cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and cuptiEnableAllDomains. For example, if cuptiGetCallbackState(sub, d, *) and cuptiEnableAllDomains(sub) are called concurrently, the results are undefined. </p> </div> </p> <p class="p"></p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1gce619a64b77d6533754de798b5e8263e" id="group__CUPTI__CALLBACK__API_1gce619a64b77d6533754de798b5e8263e" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiEnableCallback ( uint32_t<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7fde6b76bdbcafbcf750b0f91a3484f8" title="An ID for a driver API, runtime API, resource or synchronization callback. " shape="rect">CUpti_CallbackId</a><span> </span><span class="keyword keyword apiItemName">cbid</span> ) </span></dt> <dd class="description"> <div class="section">Enable or disabled callbacks for a specific domain and callback ID. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">enable</span></tt></dt> <dd>New enable state for the callback. Zero disables the callback, non-zero enables the callback. </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">subscriber</span></tt></dt> <dd>- Handle to callback subscription </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">domain</span></tt></dt> <dd>The domain of the callback </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">cbid</span></tt></dt> <dd>The ID of the callback</dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_NOT_INITIALIZED <p class="p">if unable to initialized CUPTI </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">subscriber</tt>, <tt class="ph tt code">domain</tt> or <tt class="ph tt code">cbid</tt> is invalid. </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Enable or disabled callbacks for a subscriber for a specific domain and callback ID.</p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><p class="p"><strong class="ph b">Thread-safety</strong>: a subscriber must serialize access to cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and cuptiEnableAllDomains. For example, if cuptiGetCallbackState(sub, d, c) and cuptiEnableCallback(sub, d, c) are called concurrently, the results are undefined. </p> </div> </p> <p class="p"></p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g926699208431270d4197fcb639da6a5c" id="group__CUPTI__CALLBACK__API_1g926699208431270d4197fcb639da6a5c" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiEnableDomain ( uint32_t<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span> ) </span></dt> <dd class="description"> <div class="section">Enable or disabled all callbacks for a specific domain. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">enable</span></tt></dt> <dd>New enable state for all callbacks in the domain. Zero disables all callbacks, non-zero enables all callbacks. </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">subscriber</span></tt></dt> <dd>- Handle to callback subscription </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">domain</span></tt></dt> <dd>The domain of the callback</dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_NOT_INITIALIZED <p class="p">if unable to initialized CUPTI </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">subscriber</tt> or <tt class="ph tt code">domain</tt> is invalid </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Enable or disabled all callbacks for a specific domain.</p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><p class="p"><strong class="ph b">Thread-safety</strong>: a subscriber must serialize access to cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and cuptiEnableAllDomains. For example, if cuptiGetCallbackEnabled(sub, d, *) and cuptiEnableDomain(sub, d) are called concurrently, the results are undefined. </p> </div> </p> <p class="p"></p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g0fe2357995aa7861a37e5896c6a18635" id="group__CUPTI__CALLBACK__API_1g0fe2357995aa7861a37e5896c6a18635" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiGetCallbackName ( <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span>, uint32_t<span> </span><span class="keyword keyword apiItemName">cbid</span>, const char**<span> </span><span class="keyword keyword apiItemName">name</span> ) </span></dt> <dd class="description"> <div class="section">Get the name of a callback for a specific domain and callback ID. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">domain</span></tt></dt> <dd>The domain of the callback </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">cbid</span></tt></dt> <dd>The ID of the callback </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">name</span></tt></dt> <dd>Returns pointer to the name string on success, NULL otherwise</dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">name</tt> is NULL, or if <tt class="ph tt code">domain</tt> or <tt class="ph tt code">cbid</tt> is invalid. </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Returns a pointer to the name c_string in <tt class="ph tt code">**name</tt>. </p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><p class="p"><strong class="ph b">Names</strong> are available only for the DRIVER and RUNTIME domains. </p> </div> </p> <p class="p"></p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1gf861e55f8d61286b97471e2bede138a6" id="group__CUPTI__CALLBACK__API_1gf861e55f8d61286b97471e2bede138a6" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiGetCallbackState ( uint32_t*<span> </span><span class="keyword keyword apiItemName">enable</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_CallbackDomain</a><span> </span><span class="keyword keyword apiItemName">domain</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7fde6b76bdbcafbcf750b0f91a3484f8" title="An ID for a driver API, runtime API, resource or synchronization callback. " shape="rect">CUpti_CallbackId</a><span> </span><span class="keyword keyword apiItemName">cbid</span> ) </span></dt> <dd class="description"> <div class="section">Get the current enabled/disabled state of a callback for a specific domain and function ID. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">enable</span></tt></dt> <dd>Returns non-zero if callback enabled, zero if not enabled </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">subscriber</span></tt></dt> <dd>Handle to the initialize subscriber </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">domain</span></tt></dt> <dd>The domain of the callback </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">cbid</span></tt></dt> <dd>The ID of the callback</dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_NOT_INITIALIZED <p class="p">if unable to initialized CUPTI </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">enabled</tt> is NULL, or if <tt class="ph tt code">subscriber</tt>, <tt class="ph tt code">domain</tt> or <tt class="ph tt code">cbid</tt> is invalid. </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Returns non-zero in <tt class="ph tt code">*enable</tt> if the callback for a domain and callback ID is enabled, and zero if not enabled. </p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><p class="p"><strong class="ph b">Thread-safety</strong>: a subscriber must serialize access to cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and cuptiEnableAllDomains. For example, if cuptiGetCallbackState(sub, d, c) and cuptiEnableCallback(sub, d, c) are called concurrently, the results are undefined. </p> </div> </p> <p class="p"></p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1gd2c32850b2e03b37e284df083dc9053f" id="group__CUPTI__CALLBACK__API_1gd2c32850b2e03b37e284df083dc9053f" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiSubscribe ( <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a>*<span> </span><span class="keyword keyword apiItemName">subscriber</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g84b7295694fda2bbfda931682a07bf4f" title="Function type for a callback. " shape="rect">CUpti_CallbackFunc</a><span> </span><span class="keyword keyword apiItemName">callback</span>, void*<span> </span><span class="keyword keyword apiItemName">userdata</span> ) </span></dt> <dd class="description"> <div class="section">Initialize a callback subscriber with a callback function and user data. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">subscriber</span></tt></dt> <dd>Returns handle to initialize subscriber </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">callback</span></tt></dt> <dd>The callback function </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">userdata</span></tt></dt> <dd>A pointer to user data. This data will be passed to the callback function via the <tt class="ph tt code">userdata</tt> paramater. </dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_NOT_INITIALIZED <p class="p">if unable to initialize CUPTI </p> </li> <li>CUPTI_ERROR_MAX_LIMIT_REACHED <p class="p">if there is already a CUPTI subscriber </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">subscriber</tt> is NULL </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Initializes a callback subscriber with a callback function and (optionally) a pointer to user data. The returned subscriber handle can be used to enable and disable the callback for specific domains and callback IDs. </p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><ul class="ul"> <li class="li"> <p class="p">Only a single subscriber can be registered at a time. </p> </li> <li class="li"> <p class="p">This function does not enable any callbacks. </p> </li> <li class="li"> <p class="p"><strong class="ph b">Thread-safety</strong>: this function is thread safe. </p> </li> </ul> </div> </p> <p class="p"></p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g4526fa1776292fa325971e815e0c7dc2" id="group__CUPTI__CALLBACK__API_1g4526fa1776292fa325971e815e0c7dc2" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiSupportedDomains ( size_t*<span> </span><span class="keyword keyword apiItemName">domainCount</span>, <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g9e77154dbe0cc07fb9332f95a83d6d9e" title="Callback domains. " shape="rect">CUpti_DomainTable</a>*<span> </span><span class="keyword keyword apiItemName">domainTable</span> ) </span></dt> <dd class="description"> <div class="section">Get the available callback domains. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">domainCount</span></tt></dt> <dd>Returns number of callback domains </dd> <dt><tt class="code"><span class="keyword keyword apiItemName">domainTable</span></tt></dt> <dd>Returns pointer to array of available callback domains</dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_NOT_INITIALIZED <p class="p">if unable to initialize CUPTI </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">domainCount</tt> or <tt class="ph tt code">domainTable</tt> are NULL </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Returns in <tt class="ph tt code">*domainTable</tt> an array of size <tt class="ph tt code">*domainCount</tt> of all the available callback domains. </p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><p class="p"><strong class="ph b">Thread-safety</strong>: this function is thread safe. </p> </div> </p> <p class="p"></p> </div> </dd> <dt class="description"><a name="group__CUPTI__CALLBACK__API_1g20b68c9c33f129179b56687a17356682" id="group__CUPTI__CALLBACK__API_1g20b68c9c33f129179b56687a17356682" shape="rect"> <!-- --></a><span><a href="group__CUPTI__RESULT__API.html#group__CUPTI__RESULT__API_1g8c54bf95108e67d858f37fcf76c88714" title="CUPTI result codes. " shape="rect">CUptiResult</a> cuptiUnsubscribe ( <a href="group__CUPTI__CALLBACK__API.html#group__CUPTI__CALLBACK__API_1g7932f010e8b2c785d85f4048235afca3" title="A callback subscriber. " shape="rect">CUpti_SubscriberHandle</a><span> </span><span class="keyword keyword apiItemName">subscriber</span> ) </span></dt> <dd class="description"> <div class="section">Unregister a callback subscriber. </div> <div class="section"> <h6 class="parameter_header"> Parameters </h6> <dl class="table-display-params"> <dt><tt class="code"><span class="keyword keyword apiItemName">subscriber</span></tt></dt> <dd>Handle to the initialize subscriber</dd> </dl> </div> <div class="section"> <h6 class="return_header">Returns</h6> <p class="return"> <ul> <li>CUPTI_SUCCESS <p class="p">on success </p> </li> <li>CUPTI_ERROR_NOT_INITIALIZED <p class="p">if unable to initialized CUPTI </p> </li> <li>CUPTI_ERROR_INVALID_PARAMETER <p class="p">if <tt class="ph tt code">subscriber</tt> is NULL or not initialized </p> </li> </ul> </p> </div> <div class="section"> <h6 class="description_header">Description</h6> <p>Removes a callback subscriber so that no future callbacks will be issued to that subscriber. </p> <p class="p"> <div class="note note"><span class="notetitle">Note:</span><p class="p"><strong class="ph b">Thread-safety</strong>: this function is thread safe. </p> </div> </p> <p class="p"></p> </div> </dd> </dl> </div> </div> <hr id="contents-end"></hr> </article> </div> </div> <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/formatting/common.min.js"></script> <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/scripts/google-analytics/google-analytics-write.js"></script> <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/scripts/google-analytics/google-analytics-tracker.js"></script> <script type="text/javascript">var switchTo5x=true;</script><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher: "998dc202-a267-4d8e-bce9-14debadb8d92", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script></body> </html>