Sophie

Sophie

distrib > Mageia > 7 > x86_64 > media > nonfree-updates > by-pkgid > b86a85131cc739c1c53d0b55840a4328 > files > 1516

nvidia-cuda-toolkit-devel-10.1.168-1.2.mga7.nonfree.x86_64.rpm

<!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="Stream Management"></meta>
      <meta name="abstract" content=""></meta>
      <meta name="description" content=""></meta>
      <meta name="DC.Format" content="XHTML"></meta>
      <meta name="DC.Identifier" content="group__CUDART__STREAM"></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>CUDA Runtime API :: 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="//assets.adobedtm.com/b92787824f2e0e9b68dc2e993f9bd995339fe417/satelliteLib-7ba51e58dc61bcb0e9311aadd02a0108ab24cc6c.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/cuda-runtime-api/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 
                  
                  
                  v10.1.168</a></div>
            <div class="category"><a href="index.html" title="CUDA Runtime API">CUDA Runtime API</a></div>
            <ul>
               <li>
                  <div class="section-link"><a href="driver-vs-runtime-api.html#driver-vs-runtime-api">1.&nbsp;Difference between the driver and runtime APIs </a></div>
               </li>
               <li>
                  <div class="section-link"><a href="api-sync-behavior.html#api-sync-behavior">2.&nbsp;API synchronization behavior </a></div>
               </li>
               <li>
                  <div class="section-link"><a href="stream-sync-behavior.html#stream-sync-behavior">3.&nbsp;Stream synchronization behavior</a></div>
               </li>
               <li>
                  <div class="section-link"><a href="graphs-thread-safety.html#graphs-thread-safety">4.&nbsp;Graph object thread safety</a></div>
               </li>
               <li>
                  <div class="section-link"><a href="modules.html#modules">5.&nbsp;Modules</a></div>
                  <ul>
                     <li>
                        <div class="section-link"><a href="group__CUDART__DEVICE.html#group__CUDART__DEVICE">5.1.&nbsp;Device Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__THREAD__DEPRECATED.html#group__CUDART__THREAD__DEPRECATED">5.2.&nbsp;Thread Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__ERROR.html#group__CUDART__ERROR">5.3.&nbsp;Error Handling</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__STREAM.html#group__CUDART__STREAM">5.4.&nbsp;Stream Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__EVENT.html#group__CUDART__EVENT">5.5.&nbsp;Event Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__EXTRES__INTEROP.html#group__CUDART__EXTRES__INTEROP">5.6.&nbsp;External Resource Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__EXECUTION.html#group__CUDART__EXECUTION">5.7.&nbsp;Execution Control</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__OCCUPANCY.html#group__CUDART__OCCUPANCY">5.8.&nbsp;Occupancy</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__MEMORY.html#group__CUDART__MEMORY">5.9.&nbsp;Memory Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED">5.10.&nbsp;Memory Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__UNIFIED.html#group__CUDART__UNIFIED">5.11.&nbsp;Unified Addressing</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__PEER.html#group__CUDART__PEER">5.12.&nbsp;Peer Device Memory Access</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__OPENGL.html#group__CUDART__OPENGL">5.13.&nbsp;OpenGL Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__OPENGL__DEPRECATED.html#group__CUDART__OPENGL__DEPRECATED">5.14.&nbsp;OpenGL Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D9.html#group__CUDART__D3D9">5.15.&nbsp;Direct3D 9 Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D9__DEPRECATED.html#group__CUDART__D3D9__DEPRECATED">5.16.&nbsp;Direct3D 9 Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D10.html#group__CUDART__D3D10">5.17.&nbsp;Direct3D 10 Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D10__DEPRECATED.html#group__CUDART__D3D10__DEPRECATED">5.18.&nbsp;Direct3D 10 Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D11.html#group__CUDART__D3D11">5.19.&nbsp;Direct3D 11 Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D11__DEPRECATED.html#group__CUDART__D3D11__DEPRECATED">5.20.&nbsp;Direct3D 11 Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__VDPAU.html#group__CUDART__VDPAU">5.21.&nbsp;VDPAU Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__EGL.html#group__CUDART__EGL">5.22.&nbsp;EGL Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__INTEROP.html#group__CUDART__INTEROP">5.23.&nbsp;Graphics Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__TEXTURE.html#group__CUDART__TEXTURE">5.24.&nbsp;Texture Reference Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__SURFACE.html#group__CUDART__SURFACE">5.25.&nbsp;Surface Reference Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT">5.26.&nbsp;Texture Object Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__SURFACE__OBJECT.html#group__CUDART__SURFACE__OBJECT">5.27.&nbsp;Surface Object Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART____VERSION.html#group__CUDART____VERSION">5.28.&nbsp;Version Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__GRAPH.html#group__CUDART__GRAPH">5.29.&nbsp;Graph Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL">5.30.&nbsp;C++ API Routines</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__DRIVER.html#group__CUDART__DRIVER">5.31.&nbsp;Interactions with the CUDA Driver API</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__PROFILER.html#group__CUDART__PROFILER">5.32.&nbsp;Profiler Control</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__TYPES.html#group__CUDART__TYPES">5.33.&nbsp;Data types used by CUDA Runtime</a></div>
                     </li>
                  </ul>
               </li>
               <li>
                  <div class="section-link"><a href="annotated.html#annotated">6.&nbsp;Data Structures</a></div>
                  <ul>
                     <li>
                        <div class="section-link"><a href="class____cudaOccupancyB2DHelper.html#class____cudaOccupancyB2DHelper">6.1.&nbsp;__cudaOccupancyB2DHelper</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaChannelFormatDesc.html#structcudaChannelFormatDesc">6.2.&nbsp;cudaChannelFormatDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaDeviceProp.html#structcudaDeviceProp">6.3.&nbsp;cudaDeviceProp</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaEglFrame.html#structcudaEglFrame">6.4.&nbsp;cudaEglFrame</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaEglPlaneDesc.html#structcudaEglPlaneDesc">6.5.&nbsp;cudaEglPlaneDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExtent.html#structcudaExtent">6.6.&nbsp;cudaExtent</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExternalMemoryBufferDesc.html#structcudaExternalMemoryBufferDesc">6.7.&nbsp;cudaExternalMemoryBufferDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc">6.8.&nbsp;cudaExternalMemoryHandleDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc">6.9.&nbsp;cudaExternalMemoryMipmappedArrayDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc">6.10.&nbsp;cudaExternalSemaphoreHandleDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExternalSemaphoreSignalParams.html#structcudaExternalSemaphoreSignalParams">6.11.&nbsp;cudaExternalSemaphoreSignalParams</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExternalSemaphoreWaitParams.html#structcudaExternalSemaphoreWaitParams">6.12.&nbsp;cudaExternalSemaphoreWaitParams</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaFuncAttributes.html#structcudaFuncAttributes">6.13.&nbsp;cudaFuncAttributes</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaHostNodeParams.html#structcudaHostNodeParams">6.14.&nbsp;cudaHostNodeParams</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaIpcEventHandle__t.html#structcudaIpcEventHandle__t">6.15.&nbsp;cudaIpcEventHandle_t</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaIpcMemHandle__t.html#structcudaIpcMemHandle__t">6.16.&nbsp;cudaIpcMemHandle_t</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaKernelNodeParams.html#structcudaKernelNodeParams">6.17.&nbsp;cudaKernelNodeParams</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaLaunchParams.html#structcudaLaunchParams">6.18.&nbsp;cudaLaunchParams</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaMemcpy3DParms.html#structcudaMemcpy3DParms">6.19.&nbsp;cudaMemcpy3DParms</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaMemcpy3DPeerParms.html#structcudaMemcpy3DPeerParms">6.20.&nbsp;cudaMemcpy3DPeerParms</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaMemsetParams.html#structcudaMemsetParams">6.21.&nbsp;cudaMemsetParams</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaPitchedPtr.html#structcudaPitchedPtr">6.22.&nbsp;cudaPitchedPtr</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaPointerAttributes.html#structcudaPointerAttributes">6.23.&nbsp;cudaPointerAttributes</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaPos.html#structcudaPos">6.24.&nbsp;cudaPos</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaResourceDesc.html#structcudaResourceDesc">6.25.&nbsp;cudaResourceDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaResourceViewDesc.html#structcudaResourceViewDesc">6.26.&nbsp;cudaResourceViewDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaTextureDesc.html#structcudaTextureDesc">6.27.&nbsp;cudaTextureDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUuuid__st.html#structCUuuid__st">6.28.&nbsp;CUuuid_st</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structsurfaceReference.html#structsurfaceReference">6.29.&nbsp;surfaceReference</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structtextureReference.html#structtextureReference">6.30.&nbsp;textureReference</a></div>
                     </li>
                  </ul>
               </li>
               <li>
                  <div class="section-link"><a href="functions.html#functions">7.&nbsp;Data Fields</a></div>
               </li>
               <li>
                  <div class="section-link"><a href="deprecated.html#deprecated">8.&nbsp;Deprecated List</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__CUDART__ERROR.html" shape="rect">&lt; Previous</a> | <a href="group__CUDART__EVENT.html" shape="rect">Next &gt;</a></div>
               <div id="release-info">CUDA Runtime API
                  (<a href="../../pdf/CUDA_Runtime_API.pdf">PDF</a>)
                  -
                   
                  
                  
                  v10.1.168
                  (<a href="https://developer.nvidia.com/cuda-toolkit-archive">older</a>)
                  -
                  Last updated April 24, 2019
                  -
                  <a href="mailto:CUDAIssues@nvidia.com?subject=CUDA Toolkit Documentation Feedback: CUDA Runtime API">Send Feedback</a></div>
            </div>
            <article id="contents">
               <div class="topic reference apiRef apiPackage cppModule" id="group__CUDART__STREAM"><a name="group__CUDART__STREAM" shape="rect">
                     <!-- --></a><h2 class="topictitle2 cppModule">5.4.&nbsp;Stream Management</h2>
                  <div class="section">
                     <p>This section describes the stream management functions of the CUDA runtime application programming interface. </p>
                  </div>
                  <h3 class="fake_sectiontitle member_header">Typedefs</h3>
                  <dl class="members">
                     <dt><span class="member_type">typedef 
                           void(CUDART_CB*
                           &nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g11c9452045db759adb77a40d7c98f648" shape="rect">cudaStreamCallback_t</a> )(  cudaStream_t<span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <span>&nbsp;</span><span class="keyword keyword apiItemName">cudaError_t status</span>,  void*
                           <span>&nbsp;</span><span class="keyword keyword apiItemName">userData</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc"></span></dd>
                  </dl>
                  <h3 class="fake_sectiontitle member_header">Functions</h3>
                  <dl class="members">
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" shape="rect">cudaStreamAddCallback</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g11c9452045db759adb77a40d7c98f648" title="" shape="rect">cudaStreamCallback_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">callback</span>, void*<span>&nbsp;</span><span class="keyword keyword apiItemName">userData</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Add a callback to a compute stream. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1gc3bb7ccb325219073183a629d7c2756a" shape="rect">cudaStreamAttachMemAsync</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, void*<span>&nbsp;</span><span class="keyword keyword apiItemName">devPtr</span>, size_t<span>&nbsp;</span><span class="keyword keyword apiItemName">length</span> = <span class="ph ph apiData">0</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> = <span class="ph ph apiData">cudaMemAttachSingle</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Attach memory to a stream asynchronously. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" shape="rect">cudaStreamBeginCapture</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g24ae5ae00cc50614957ff8eba43e560e" title="" shape="rect">cudaStreamCaptureMode</a><span>&nbsp;</span><span class="keyword keyword apiItemName">mode</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Begins graph capture on a stream. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" shape="rect">cudaStreamCreate</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pStream</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Create an asynchronous stream. </span></dd>
                     <dt><span class="member_long_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​
                           <span class="keyword keyword apiItemName">__device__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name_long_type"><a href="#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" shape="rect">cudaStreamCreateWithFlags</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pStream</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Create an asynchronous stream. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" shape="rect">cudaStreamCreateWithPriority</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pStream</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span>, int <span>&nbsp;</span><span class="keyword keyword apiItemName">priority</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Create an asynchronous stream with the specified priority. </span></dd>
                     <dt><span class="member_long_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​
                           <span class="keyword keyword apiItemName">__device__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name_long_type"><a href="#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" shape="rect">cudaStreamDestroy</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Destroys and cleans up an asynchronous stream. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" shape="rect">cudaStreamEndCapture</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g5707132c494c91db57db5a6da0beba4c" title="" shape="rect">cudaGraph_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pGraph</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Ends capture on a stream, returning the captured graph. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1gf5e3d83df446930f0190af7e6eebdd47" shape="rect">cudaStreamGetCaptureInfo</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g0ec4aacc66fe76c145252d12b189e233" title="" shape="rect">cudaStreamCaptureStatus *</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCaptureStatus</span>, unsigned long long*<span>&nbsp;</span><span class="keyword keyword apiItemName">pId</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Query capture status of a stream. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1ga7f311f88126d751b9a7d3302ad6d0f8" shape="rect">cudaStreamGetFlags</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, unsigned int*<span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Query the flags of a stream. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g192bb727d15c4407c119747de7d198a6" shape="rect">cudaStreamGetPriority</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, int*<span>&nbsp;</span><span class="keyword keyword apiItemName">priority</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Query the priority of a stream. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1ge564e8434c67d716367931c4bc7db1cc" shape="rect">cudaStreamIsCapturing</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g0ec4aacc66fe76c145252d12b189e233" title="" shape="rect">cudaStreamCaptureStatus *</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCaptureStatus</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Returns a stream's capture status. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" shape="rect">cudaStreamQuery</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Queries an asynchronous stream for completion status. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" shape="rect">cudaStreamSynchronize</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Waits for stream tasks to complete. </span></dd>
                     <dt><span class="member_long_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​
                           <span class="keyword keyword apiItemName">__device__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name_long_type"><a href="#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" shape="rect">cudaStreamWaitEvent</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gea2f543a9fc0e52fe4ae712920fd1247" title="" shape="rect">cudaEvent_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">event</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Make a compute stream wait on an event. </span></dd>
                     <dt><span class="member_type"><span class="keyword keyword apiItemName">__host__</span>
                           ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85" shape="rect">cudaThreadExchangeStreamCaptureMode</a> (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g24ae5ae00cc50614957ff8eba43e560e" title="" shape="rect">cudaStreamCaptureMode *</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">mode</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Swaps the stream capture interaction mode for a thread. </span></dd>
                  </dl>
                  <div class="description">
                     <h3 class="sectiontitle">Typedefs</h3>
                     <dl class="description">
                        <dt class="description"><a name="group__CUDART__STREAM_1g11c9452045db759adb77a40d7c98f648" id="group__CUDART__STREAM_1g11c9452045db759adb77a40d7c98f648" shape="rect">
                              <!-- --></a><span>
                              void(CUDART_CB*
                              cudaStreamCallback_t )(  cudaStream_t<span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <span>&nbsp;</span><span class="keyword keyword apiItemName">cudaError_t status</span>,  void*
                              <span>&nbsp;</span><span class="keyword keyword apiItemName">userData</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">
                              <p> Type of stream callback functions. 
                                 
                              </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">stream</span></tt></dt>
                              <dd>The stream as passed to <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, may be NULL. 
                              </dd>
                              <dt><tt class="code"><span class="keyword keyword apiItemName">cudaError_t status</span></tt></dt>
                              <dd></dd>
                              <dt><tt class="code"><span class="keyword keyword apiItemName">userData</span></tt></dt>
                              <dd>User parameter provided at registration. </dd>
                           </dl>
                        </div>
                     </dl>
                  </div>
                  <div class="description">
                     <h3 class="sectiontitle">Functions</h3>
                     <dl class="description">
                        <dt class="description"><a name="group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" id="group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamAddCallback (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g11c9452045db759adb77a40d7c98f648" title="" shape="rect">cudaStreamCallback_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">callback</span>, void*<span>&nbsp;</span><span class="keyword keyword apiItemName">userData</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Add a callback to a compute stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream to add callback to </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">callback</span></tt></dt>
                                 <dd>- The function to call once preceding stream operations are complete </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">userData</span></tt></dt>
                                 <dd>- User specified data to be passed to the callback function </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Reserved for future use, must be 0</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038d846fd9f2e8ba5e2fb4f1695b7ab6164" shape="rect">cudaErrorNotSupported</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">This function is slated for eventual deprecation and removal. If you do not require the callback to execute in case of a device
                                       error, consider using <a class="xref" href="group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1g05841eaa5f90f27124241baafb3e856f" title="Enqueues a host function call in a stream." shape="rect">cudaLaunchHostFunc</a>. Additionally, this function is not supported with <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a> and <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" title="Ends capture on a stream, returning the captured graph." shape="rect">cudaStreamEndCapture</a>, unlike <a class="xref" href="group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1g05841eaa5f90f27124241baafb3e856f" title="Enqueues a host function call in a stream." shape="rect">cudaLaunchHostFunc</a>.
                                    </p>
                                 </div>
                              </p>
                              <p class="p">
                                 Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each cudaStreamAddCallback
                                 call, a callback will be executed exactly once. The callback will block later work in the stream until it is finished.
                              </p>
                              <p class="p">The callback may be passed <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a> or an error code. In the event of a device error, all subsequently executed callbacks will receive an appropriate <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" shape="rect">cudaError_t</a>.
                              </p>
                              <p class="p">Callbacks must not make any CUDA API calls. Attempting to use CUDA APIs may result in <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a>. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not
                                 mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be
                                 serialized.
                              </p>
                              <p class="p">For the purposes of Unified Memory, callback execution makes a number of guarantees: 
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p">The callback stream is considered idle for the duration of the callback. Thus, for example, a callback may always use memory
                                          attached to the callback stream. 
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p">The start of execution of a callback has the same effect as synchronizing an event recorded in the same stream immediately
                                          prior to the callback. It thus synchronizes streams which have been "joined" prior to the callback. 
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p">Adding device work to any stream does not have the effect of making the stream active until all preceding callbacks have executed.
                                          Thus, for example, a callback might use global attached memory even if work has been added to another stream, if it has been
                                          properly ordered with an event. 
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p">Completion of a callback does not cause a stream to become active except as described above. The callback stream will remain
                                          idle if no device work follows the callback, and will remain idle across consecutive callbacks without device work in between.
                                          Thus, for example, stream synchronization can be done by signaling from a callback at the end of the stream. 
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">This function uses standard  <a class="xref xmlonly" href="stream-sync-behavior.html#stream-sync-behavior__default-stream" shape="rect">default stream</a> semantics. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" title="Queries an asynchronous stream for completion status." shape="rect">cudaStreamQuery</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gcf6b9b1019e73c5bc2b39b39fe90816e" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cudaMallocManaged</a>, <a class="xref" href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g496353d630c29c44a2e33f531a3944d1" title="Attach memory to a stream asynchronously." shape="rect">cudaStreamAttachMemAsync</a>, <a class="xref" href="group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1g05841eaa5f90f27124241baafb3e856f" title="Enqueues a host function call in a stream." shape="rect">cudaLaunchHostFunc</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" target="_blank" shape="rect">cuStreamAddCallback</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1gc3bb7ccb325219073183a629d7c2756a" id="group__CUDART__STREAM_1gc3bb7ccb325219073183a629d7c2756a" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamAttachMemAsync (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, void*<span>&nbsp;</span><span class="keyword keyword apiItemName">devPtr</span>, size_t<span>&nbsp;</span><span class="keyword keyword apiItemName">length</span> = <span class="ph ph apiData">0</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> = <span class="ph ph apiData">cudaMemAttachSingle</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Attach memory to a stream asynchronously. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream in which to enqueue the attach operation </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">devPtr</span></tt></dt>
                                 <dd>- Pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of system-allocated memory)
                                    
                                 </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">length</span></tt></dt>
                                 <dd>- Length of memory (defaults to zero) </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Must be one of <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4808e47eba73eb94622ec70a9f9b91ff" shape="rect">cudaMemAttachGlobal</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4f9a428d18fdd89a99441d0dd27131c0" shape="rect">cudaMemAttachHost</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gdc191442d08fc3a9de4cf055edfd2dbe" shape="rect">cudaMemAttachSingle</a> (defaults to <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gdc191442d08fc3a9de4cf055edfd2dbe" shape="rect">cudaMemAttachSingle</a>)
                                 </dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d" shape="rect">cudaErrorNotReady</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Enqueues an operation in <tt class="ph tt code">stream</tt> to specify stream association of <tt class="ph tt code">length</tt> bytes of memory starting from <tt class="ph tt code">devPtr</tt>. This function is a stream-ordered operation, meaning that it is dependent on, and will only take effect when, previous work
                                 in stream has completed. Any previous association is automatically replaced.
                              </p>
                              <p class="p"><tt class="ph tt code">devPtr</tt> must point to an one of the following types of memories:
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p">managed memory declared using the __managed__ keyword or allocated with <a class="xref" href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gcf6b9b1019e73c5bc2b39b39fe90816e" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cudaMallocManaged</a>.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p">a valid host-accessible region of system-allocated pageable memory. This type of memory may only be specified if the device
                                          associated with the stream reports a non-zero value for the device attribute <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cddc80992427a92713e699953a6d249d6f" shape="rect">cudaDevAttrPageableMemoryAccess</a>.
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p">For managed allocations, <tt class="ph tt code">length</tt> must be either zero or the entire allocation's size. Both indicate that the entire allocation's stream association is being
                                 changed. Currently, it is not possible to change stream association for a portion of a managed allocation.
                              </p>
                              <p class="p">For pageable allocations, <tt class="ph tt code">length</tt> must be non-zero.
                              </p>
                              <p class="p">The stream association is specified using <tt class="ph tt code">flags</tt> which must be one of <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4808e47eba73eb94622ec70a9f9b91ff" shape="rect">cudaMemAttachGlobal</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4f9a428d18fdd89a99441d0dd27131c0" shape="rect">cudaMemAttachHost</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gdc191442d08fc3a9de4cf055edfd2dbe" shape="rect">cudaMemAttachSingle</a>. The default value for <tt class="ph tt code">flags</tt> is <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gdc191442d08fc3a9de4cf055edfd2dbe" shape="rect">cudaMemAttachSingle</a> If the <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4808e47eba73eb94622ec70a9f9b91ff" shape="rect">cudaMemAttachGlobal</a> flag is specified, the memory can be accessed by any stream on any device. If the <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4f9a428d18fdd89a99441d0dd27131c0" shape="rect">cudaMemAttachHost</a> flag is specified, the program makes a guarantee that it won't access the memory on the device from any stream on a device
                                 that has a zero value for the device attribute <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09" shape="rect">cudaDevAttrConcurrentManagedAccess</a>. If the <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gdc191442d08fc3a9de4cf055edfd2dbe" shape="rect">cudaMemAttachSingle</a> flag is specified and <tt class="ph tt code">stream</tt> is associated with a device that has a zero value for the device attribute <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09" shape="rect">cudaDevAttrConcurrentManagedAccess</a>, the program makes a guarantee that it will only access the memory on the device from <tt class="ph tt code">stream</tt>. It is illegal to attach singly to the NULL stream, because the NULL stream is a virtual global stream and not a specific
                                 stream. An error will be returned in this case.
                              </p>
                              <p class="p">When memory is associated with a single stream, the Unified Memory system will allow CPU access to this memory region so long
                                 as all operations in <tt class="ph tt code">stream</tt> have completed, regardless of whether other streams are active. In effect, this constrains exclusive ownership of the managed
                                 memory region by an active GPU to per-stream activity instead of whole-GPU activity.
                              </p>
                              <p class="p">Accessing memory on the device from streams that are not associated with it will produce undefined results. No error checking
                                 is performed by the Unified Memory system to ensure that kernels launched into other streams do not access this region.
                              </p>
                              <p class="p">It is a program's responsibility to order calls to <a class="xref" href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g496353d630c29c44a2e33f531a3944d1" title="Attach memory to a stream asynchronously." shape="rect">cudaStreamAttachMemAsync</a> via events, synchronization or other means to ensure legal access to memory at all times. Data visibility and coherency will
                                 be changed appropriately for all kernels which follow a stream-association change.
                              </p>
                              <p class="p">If <tt class="ph tt code">stream</tt> is destroyed while data is associated with it, the association is removed and the association reverts to the default visibility
                                 of the allocation as specified at <a class="xref" href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gcf6b9b1019e73c5bc2b39b39fe90816e" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cudaMallocManaged</a>. For __managed__ variables, the default association is always <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4808e47eba73eb94622ec70a9f9b91ff" shape="rect">cudaMemAttachGlobal</a>. Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won't happen
                                 until all work in the stream has completed.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gcf6b9b1019e73c5bc2b39b39fe90816e" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cudaMallocManaged</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g6e468d680e263e7eba02a56643c50533" target="_blank" shape="rect">cuStreamAttachMemAsync</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" id="group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamBeginCapture (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g24ae5ae00cc50614957ff8eba43e560e" title="" shape="rect">cudaStreamCaptureMode</a><span>&nbsp;</span><span class="keyword keyword apiItemName">mode</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Begins graph capture on a stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream in which to initiate capture </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">mode</span></tt></dt>
                                 <dd>- Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see
                                    <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85" title="Swaps the stream capture interaction mode for a thread." shape="rect">cudaThreadExchangeStreamCaptureMode</a>.
                                 </dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Begin graph capture on <tt class="ph tt code">stream</tt>. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured
                                 into a graph, which will be returned via <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" title="Ends capture on a stream, returning the captured graph." shape="rect">cudaStreamEndCapture</a>. Capture may not be initiated if <tt class="ph tt code">stream</tt> is <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4e62d09dde16ba457b0a97f3a5262246" shape="rect">cudaStreamLegacy</a>. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already
                                 in capture mode. The capture mode may be queried via <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge564e8434c67d716367931c4bc7db1cc" title="Returns a stream's capture status." shape="rect">cudaStreamIsCapturing</a>. A unique id representing the capture sequence may be queried via <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5e3d83df446930f0190af7e6eebdd47" title="Query capture status of a stream." shape="rect">cudaStreamGetCaptureInfo</a>.
                              </p>
                              <p class="p">If <tt class="ph tt code">mode</tt> is not cudaStreamCaptureModeRelaxed, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" title="Ends capture on a stream, returning the captured graph." shape="rect">cudaStreamEndCapture</a> must be called on this stream from the same thread.
                              </p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface
                                       reference is undefined behavior. This restriction does not apply to texture and surface objects.
                                    </p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Note that this function may also return error codes from previous, asynchronous launches.</p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge564e8434c67d716367931c4bc7db1cc" title="Returns a stream's capture status." shape="rect">cudaStreamIsCapturing</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" title="Ends capture on a stream, returning the captured graph." shape="rect">cudaStreamEndCapture</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85" title="Swaps the stream capture interaction mode for a thread." shape="rect">cudaThreadExchangeStreamCaptureMode</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" id="group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamCreate (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pStream</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Create an asynchronous stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pStream</span></tt></dt>
                                 <dd>- Pointer to new stream identifier</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Creates a new asynchronous stream.</p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" title="Create an asynchronous stream with the specified priority." shape="rect">cudaStreamCreateWithPriority</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g192bb727d15c4407c119747de7d198a6" title="Query the priority of a stream." shape="rect">cudaStreamGetPriority</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ga7f311f88126d751b9a7d3302ad6d0f8" title="Query the flags of a stream." shape="rect">cudaStreamGetFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" title="Queries an asynchronous stream for completion status." shape="rect">cudaStreamQuery</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" target="_blank" shape="rect">cuStreamCreate</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" id="group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​
                              <span class="keyword keyword apiItemName">__device__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamCreateWithFlags (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pStream</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Create an asynchronous stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pStream</span></tt></dt>
                                 <dd>- Pointer to new stream identifier </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Parameters for stream creation</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Creates a new asynchronous stream. The <tt class="ph tt code">flags</tt> argument determines the behaviors of the stream. Valid values for <tt class="ph tt code">flags</tt> are
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ged347a89ec289c787faa116b851708fc" shape="rect">cudaStreamDefault</a>: Default stream creation flag.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g5dbd11a1723d9f5938a133cedbc525e3" shape="rect">cudaStreamNonBlocking</a>: Specifies that work running in the created stream may run concurrently with work in stream 0 (the NULL stream), and that
                                          the created stream should perform no implicit synchronization with stream 0.
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" title="Create an asynchronous stream with the specified priority." shape="rect">cudaStreamCreateWithPriority</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ga7f311f88126d751b9a7d3302ad6d0f8" title="Query the flags of a stream." shape="rect">cudaStreamGetFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" title="Queries an asynchronous stream for completion status." shape="rect">cudaStreamQuery</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" target="_blank" shape="rect">cuStreamCreate</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" id="group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamCreateWithPriority (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pStream</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span>, int <span>&nbsp;</span><span class="keyword keyword apiItemName">priority</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Create an asynchronous stream with the specified priority. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pStream</span></tt></dt>
                                 <dd>- Pointer to new stream identifier </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Flags for stream creation. See <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a> for a list of valid flags that can be passed 
                                 </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">priority</span></tt></dt>
                                 <dd>- Priority of the stream. Lower numbers represent higher priorities. See <a class="xref" href="group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gfdb79818f7c0ee7bc585648c91770275" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cudaDeviceGetStreamPriorityRange</a> for more information about the meaningful stream priorities that can be passed.
                                 </dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Creates a stream with the specified priority and returns a handle in <tt class="ph tt code">pStream</tt>. This API alters the scheduler priority of work in the stream. Work in a higher priority stream may preempt work already
                                 executing in a low priority stream.
                              </p>
                              <p class="p"><tt class="ph tt code">priority</tt> follows a convention where lower numbers represent higher priorities. '0' represents default priority. The range of meaningful
                                 numerical priorities can be queried using <a class="xref" href="group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gfdb79818f7c0ee7bc585648c91770275" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cudaDeviceGetStreamPriorityRange</a>. If the specified priority is outside the numerical range returned by <a class="xref" href="group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gfdb79818f7c0ee7bc585648c91770275" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cudaDeviceGetStreamPriorityRange</a>, it will automatically be clamped to the lowest or the highest number in the range.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Stream priorities are supported only on GPUs with compute capability 3.5 or higher.</p>
                                       </li>
                                       <li class="li">
                                          <p class="p">In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream
                                             priorities have no effect on host-to-device and device-to-host memory operations.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gfdb79818f7c0ee7bc585648c91770275" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cudaDeviceGetStreamPriorityRange</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g192bb727d15c4407c119747de7d198a6" title="Query the priority of a stream." shape="rect">cudaStreamGetPriority</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" title="Queries an asynchronous stream for completion status." shape="rect">cudaStreamQuery</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" target="_blank" shape="rect">cuStreamCreateWithPriority</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" id="group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​
                              <span class="keyword keyword apiItemName">__device__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamDestroy (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Destroys and cleans up an asynchronous stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream identifier</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Destroys and cleans up the asynchronous stream specified by <tt class="ph tt code">stream</tt>.
                              </p>
                              <p class="p">In case the device is still doing work in the stream <tt class="ph tt code">stream</tt> when <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy()</a> is called, the function will return immediately and the resources associated with <tt class="ph tt code">stream</tt> will be released automatically once the device has completed all work in <tt class="ph tt code">stream</tt>.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">This function uses standard  <a class="xref xmlonly" href="stream-sync-behavior.html#stream-sync-behavior__default-stream" shape="rect">default stream</a> semantics. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" title="Queries an asynchronous stream for completion status." shape="rect">cudaStreamQuery</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" target="_blank" shape="rect">cuStreamDestroy</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" id="group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamEndCapture (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g5707132c494c91db57db5a6da0beba4c" title="" shape="rect">cudaGraph_t</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pGraph</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Ends capture on a stream, returning the captured graph. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream to query </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pGraph</span></tt></dt>
                                 <dd>- The captured graph</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00385627c9161ac543c5b473c64e2e6a6eb4" shape="rect">cudaErrorStreamCaptureWrongThread</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>End capture on <tt class="ph tt code">stream</tt>, returning the captured graph via <tt class="ph tt code">pGraph</tt>. Capture must have been initiated on <tt class="ph tt code">stream</tt> via a call to <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>. If capture was invalidated, due to a violation of the rules of stream capture, then a NULL graph will be returned.
                              </p>
                              <p class="p">If the <tt class="ph tt code">mode</tt> argument to <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a> was not cudaStreamCaptureModeRelaxed, this call must be from the same thread as <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Note that this function may also return error codes from previous, asynchronous launches.</p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge564e8434c67d716367931c4bc7db1cc" title="Returns a stream's capture status." shape="rect">cudaStreamIsCapturing</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1gf5e3d83df446930f0190af7e6eebdd47" id="group__CUDART__STREAM_1gf5e3d83df446930f0190af7e6eebdd47" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamGetCaptureInfo (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g0ec4aacc66fe76c145252d12b189e233" title="" shape="rect">cudaStreamCaptureStatus *</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCaptureStatus</span>, unsigned long long*<span>&nbsp;</span><span class="keyword keyword apiItemName">pId</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Query capture status of a stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream to query </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pCaptureStatus</span></tt></dt>
                                 <dd>- Returns the stream's capture status </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pId</span></tt></dt>
                                 <dd>- Returns the unique id of the capture sequence</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038cf775033deb76dbde57b8df7bd9244e7" shape="rect">cudaErrorStreamCaptureImplicit</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Query the capture status of a stream and get a unique id representing the capture sequence over the lifetime of the process.</p>
                              <p class="p">If called on <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4e62d09dde16ba457b0a97f3a5262246" shape="rect">cudaStreamLegacy</a> (the "null stream") while a stream not created with <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g5dbd11a1723d9f5938a133cedbc525e3" shape="rect">cudaStreamNonBlocking</a> is capturing, returns <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038cf775033deb76dbde57b8df7bd9244e7" shape="rect">cudaErrorStreamCaptureImplicit</a>.
                              </p>
                              <p class="p">A valid id is returned only if both of the following are true:
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p">the call returns <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a></p>
                                    </li>
                                    <li class="li">
                                       <p class="p">captureStatus is set to <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e233b165b0917377d0d7283ca5ac8013568b" shape="rect">cudaStreamCaptureStatusActive</a></p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Note that this function may also return error codes from previous, asynchronous launches.</p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge564e8434c67d716367931c4bc7db1cc" title="Returns a stream's capture status." shape="rect">cudaStreamIsCapturing</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1ga7f311f88126d751b9a7d3302ad6d0f8" id="group__CUDART__STREAM_1ga7f311f88126d751b9a7d3302ad6d0f8" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamGetFlags (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, unsigned int*<span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Query the flags of a stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">hStream</span></tt></dt>
                                 <dd>- Handle to the stream to be queried </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Pointer to an unsigned integer in which the stream's flags are returned</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Query the flags of a stream. The flags are returned in <tt class="ph tt code">flags</tt>. See <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a> for a list of valid flags.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">This function uses standard  <a class="xref xmlonly" href="stream-sync-behavior.html#stream-sync-behavior__default-stream" shape="rect">default stream</a> semantics. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" title="Create an asynchronous stream with the specified priority." shape="rect">cudaStreamCreateWithPriority</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g192bb727d15c4407c119747de7d198a6" title="Query the priority of a stream." shape="rect">cudaStreamGetPriority</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7" target="_blank" shape="rect">cuStreamGetFlags</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1g192bb727d15c4407c119747de7d198a6" id="group__CUDART__STREAM_1g192bb727d15c4407c119747de7d198a6" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamGetPriority (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, int*<span>&nbsp;</span><span class="keyword keyword apiItemName">priority</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Query the priority of a stream. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">hStream</span></tt></dt>
                                 <dd>- Handle to the stream to be queried </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">priority</span></tt></dt>
                                 <dd>- Pointer to a signed integer in which the stream's priority is returned</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Query the priority of a stream. The priority is returned in in <tt class="ph tt code">priority</tt>. Note that if the stream was created with a priority outside the meaningful numerical range returned by <a class="xref" href="group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gfdb79818f7c0ee7bc585648c91770275" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cudaDeviceGetStreamPriorityRange</a>, this function returns the clamped priority. See <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" title="Create an asynchronous stream with the specified priority." shape="rect">cudaStreamCreateWithPriority</a> for details about priority clamping.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540" title="Create an asynchronous stream with the specified priority." shape="rect">cudaStreamCreateWithPriority</a>, <a class="xref" href="group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gfdb79818f7c0ee7bc585648c91770275" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cudaDeviceGetStreamPriorityRange</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1ga7f311f88126d751b9a7d3302ad6d0f8" title="Query the flags of a stream." shape="rect">cudaStreamGetFlags</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484" target="_blank" shape="rect">cuStreamGetPriority</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1ge564e8434c67d716367931c4bc7db1cc" id="group__CUDART__STREAM_1ge564e8434c67d716367931c4bc7db1cc" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamIsCapturing (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g0ec4aacc66fe76c145252d12b189e233" title="" shape="rect">cudaStreamCaptureStatus *</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCaptureStatus</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Returns a stream's capture status. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream to query </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pCaptureStatus</span></tt></dt>
                                 <dd>- Returns the stream's capture status</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038cf775033deb76dbde57b8df7bd9244e7" shape="rect">cudaErrorStreamCaptureImplicit</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Return the capture status of <tt class="ph tt code">stream</tt> via <tt class="ph tt code">pCaptureStatus</tt>. After a successful call, <tt class="ph tt code">*pCaptureStatus</tt> will contain one of the following:
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e233dbbe6269245e62cd99e6c95206008e50" shape="rect">cudaStreamCaptureStatusNone</a>: The stream is not capturing.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e233b165b0917377d0d7283ca5ac8013568b" shape="rect">cudaStreamCaptureStatusActive</a>: The stream is capturing.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e2334c61e87e6268a6f9b6c928c574c12c76" shape="rect">cudaStreamCaptureStatusInvalidated</a>: The stream was capturing but an error has invalidated the capture sequence. The capture sequence must be terminated with
                                          <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" title="Ends capture on a stream, returning the captured graph." shape="rect">cudaStreamEndCapture</a> on the stream where it was initiated in order to continue using <tt class="ph tt code">stream</tt>.
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p">Note that, if this is called on <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g4e62d09dde16ba457b0a97f3a5262246" shape="rect">cudaStreamLegacy</a> (the "null stream") while a blocking stream on the same device is capturing, it will return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038cf775033deb76dbde57b8df7bd9244e7" shape="rect">cudaErrorStreamCaptureImplicit</a> and <tt class="ph tt code">*pCaptureStatus</tt> is unspecified after the call. The blocking stream capture is not invalidated.
                              </p>
                              <p class="p">When a blocking stream is capturing, the legacy stream is in an unusable state until the blocking stream capture is terminated.
                                 The legacy stream is not supported for stream capture, but attempted use would have an implicit dependency on the capturing
                                 stream(s).
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Note that this function may also return error codes from previous, asynchronous launches.</p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" title="Ends capture on a stream, returning the captured graph." shape="rect">cudaStreamEndCapture</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" id="group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamQuery (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Queries an asynchronous stream for completion status. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream identifier</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d" shape="rect">cudaErrorNotReady</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Returns <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a> if all operations in <tt class="ph tt code">stream</tt> have completed, or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d" shape="rect">cudaErrorNotReady</a> if not.
                              </p>
                              <p class="p">For the purposes of Unified Memory, a return value of <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a> is equivalent to having called <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize()</a>.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">This function uses standard  <a class="xref xmlonly" href="stream-sync-behavior.html#stream-sync-behavior__default-stream" shape="rect">default stream</a> semantics. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" target="_blank" shape="rect">cuStreamQuery</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" id="group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamSynchronize (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Waits for stream tasks to complete. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream identifier</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Blocks until <tt class="ph tt code">stream</tt> has completed all operations. If the <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g057e6912c52708b6aa86e79dd83d007c" shape="rect">cudaDeviceScheduleBlockingSync</a> flag was set for this device, the host thread will block until the stream is finished with all of its tasks.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">This function uses standard  <a class="xref xmlonly" href="stream-sync-behavior.html#stream-sync-behavior__default-stream" shape="rect">default stream</a> semantics. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" title="Queries an asynchronous stream for completion status." shape="rect">cudaStreamQuery</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" title="Make a compute stream wait on an event." shape="rect">cudaStreamWaitEvent</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" target="_blank" shape="rect">cuStreamSynchronize</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" id="group__CUDART__STREAM_1gc301fd024e6fd4a17074d229d4504077" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​
                              <span class="keyword keyword apiItemName">__device__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaStreamWaitEvent (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ge15d9c8b7a240312b533d6122558085a" title="" shape="rect">cudaStream_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">stream</span>, <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gea2f543a9fc0e52fe4ae712920fd1247" title="" shape="rect">cudaEvent_t</a><span>&nbsp;</span><span class="keyword keyword apiItemName">event</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Make a compute stream wait on an event. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">stream</span></tt></dt>
                                 <dd>- Stream to wait </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">event</span></tt></dt>
                                 <dd>- Event to wait on </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Parameters for the operation (must be 0)</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Makes all future work submitted to <tt class="ph tt code">stream</tt> wait for all work captured in <tt class="ph tt code">event</tt>. See <a class="xref" href="group__CUDART__EVENT.html#group__CUDART__EVENT_1gf4fcb74343aa689f4159791967868446" title="Records an event." shape="rect">cudaEventRecord()</a> for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable.
                                 <tt class="ph tt code">event</tt> may be from a different device than <tt class="ph tt code">stream</tt>.
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><ul class="ul">
                                       <li class="li">
                                          <p class="p">This function uses standard  <a class="xref xmlonly" href="stream-sync-behavior.html#stream-sync-behavior__default-stream" shape="rect">default stream</a> semantics. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return error codes from previous, asynchronous launches. </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that this function may also return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c" shape="rect">cudaErrorInitializationError</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067" shape="rect">cudaErrorInsufficientDriver</a> or <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a> if this call tries to initialize internal CUDA RT state. 
                                          </p>
                                       </li>
                                       <li class="li">
                                          <p class="p">Note that as specified by <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a> no CUDA function may be called from callback. <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3" shape="rect">cudaErrorNotPermitted</a> may, but is not guaranteed to, be returned as a diagnostic in such case.
                                          </p>
                                       </li>
                                    </ul>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da" title="Create an asynchronous stream." shape="rect">cudaStreamCreate</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3" title="Create an asynchronous stream." shape="rect">cudaStreamCreateWithFlags</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435" title="Queries an asynchronous stream for completion status." shape="rect">cudaStreamQuery</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e" title="Waits for stream tasks to complete." shape="rect">cudaStreamSynchronize</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498" title="Add a callback to a compute stream." shape="rect">cudaStreamAddCallback</a>, <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62" title="Destroys and cleans up an asynchronous stream." shape="rect">cudaStreamDestroy</a>, <a class="xref" href="../cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" target="_blank" shape="rect">cuStreamWaitEvent</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85" id="group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85" shape="rect">
                              <!-- --></a><span><span class="keyword keyword apiItemName">__host__</span>
                              ​<a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaThreadExchangeStreamCaptureMode (  <a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g24ae5ae00cc50614957ff8eba43e560e" title="" shape="rect">cudaStreamCaptureMode *</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">mode</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Swaps the stream capture interaction mode for a thread. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">mode</span></tt></dt>
                                 <dd>- Pointer to mode value to swap with the current mode</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Sets the calling thread's stream capture interaction mode to the value contained in <tt class="ph tt code">*mode</tt>, and overwrites <tt class="ph tt code">*mode</tt> with the previous mode for the thread. To facilitate deterministic behavior across function or module boundaries, callers
                                 are encouraged to use this API in a push-pop fashion: <pre xml:space="preserve">‎     <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1g24ae5ae00cc50614957ff8eba43e560e" shape="rect">cudaStreamCaptureMode</a> mode = desiredMode;
           <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85" title="Swaps the stream capture interaction mode for a thread." shape="rect">cudaThreadExchangeStreamCaptureMode</a>(&amp;mode);
           ...
           <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g9d0535d93a214cbf126835257b16ba85" title="Swaps the stream capture interaction mode for a thread." shape="rect">cudaThreadExchangeStreamCaptureMode</a>(&amp;mode); // restore previous mode</pre></p>
                              <p class="p">During stream capture (see <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>), some actions, such as a call to <a class="xref" href="group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g37d37965bfb4803b6d4e59ff26856356" title="Allocate memory on the device." shape="rect">cudaMalloc</a>, may be unsafe. In the case of <a class="xref" href="group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g37d37965bfb4803b6d4e59ff26856356" title="Allocate memory on the device." shape="rect">cudaMalloc</a>, the operation is not enqueued asynchronously to a stream, and is not observed by stream capture. Therefore, if the sequence
                                 of operations captured via <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a> depended on the allocation being replayed whenever the graph is launched, the captured graph would be invalid.
                              </p>
                              <p class="p">Therefore, stream capture places restrictions on API calls that can be made within or concurrently to a <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>-<a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1gf5a0efebc818054ceecd1e3e5e76d93e" title="Ends capture on a stream, returning the captured graph." shape="rect">cudaStreamEndCapture</a> sequence. This behavior can be controlled via this API and flags to <a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a>.
                              </p>
                              <p class="p">A thread's mode is one of the following:
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p"><tt class="ph tt code">cudaStreamCaptureModeGlobal:</tt> This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with <tt class="ph tt code">cudaStreamCaptureModeRelaxed</tt> at <tt class="ph tt code">cuStreamBeginCapture</tt>, or if any other thread has a concurrent capture sequence initiated with <tt class="ph tt code">cudaStreamCaptureModeGlobal</tt>, this thread is prohibited from potentially unsafe API calls.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><tt class="ph tt code">cudaStreamCaptureModeThreadLocal:</tt> If the local thread has an ongoing capture sequence not initiated with <tt class="ph tt code">cudaStreamCaptureModeRelaxed</tt>, it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><tt class="ph tt code">cudaStreamCaptureModeRelaxed:</tt> The local thread is not prohibited from potentially unsafe API calls. Note that the thread is still prohibited from API calls
                                          which necessarily conflict with stream capture, for example, attempting <a class="xref" href="group__CUDART__EVENT.html#group__CUDART__EVENT_1g2bf738909b4a059023537eaa29d8a5b7" title="Queries an event's status." shape="rect">cudaEventQuery</a> on an event that was last recorded inside a capture sequence.
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Note that this function may also return error codes from previous, asynchronous launches.</p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__STREAM.html#group__CUDART__STREAM_1g793d7d4e474388ddfda531603dc34aa3" title="Begins graph capture on a stream." shape="rect">cudaStreamBeginCapture</a></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><script type="text/javascript">_satellite.pageBottom();</script></body>
</html>