Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > nonfree-release > by-pkgid > d44b02ea46d82d6a48df31bbd1a088f3 > files > 1090

nvidia-cuda-toolkit-devel-6.5.14-6.mga5.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__CUDA__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 Driver 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="../common/scripts/tynt/tynt.js"></script>
      <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.min.js"></script>
      <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.ba-hashchange.min.js"></script>
      <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.scrollintoview.min.js"></script>
      <script type="text/javascript" src="../search/htmlFileList.js"></script>
      <script type="text/javascript" src="../search/htmlFileInfoList.js"></script>
      <script type="text/javascript" src="../search/nwSearchFnt.min.js"></script>
      <script type="text/javascript" src="../search/stemmers/en_stemmer.min.js"></script>
      <script type="text/javascript" src="../search/index-1.js"></script>
      <script type="text/javascript" src="../search/index-2.js"></script>
      <script type="text/javascript" src="../search/index-3.js"></script>
      <link rel="canonical" href="http://docs.nvidia.com/cuda/cuda-driver-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
                  v6.5</a></div>
            <div class="category"><a href="index.html" title="CUDA Driver API">CUDA Driver API</a></div>
            <ul>
               <li>
                  <div class="section-link"><a href="api-sync-behavior.html#api-sync-behavior">1.&nbsp;API synchronization behavior </a></div>
               </li>
               <li>
                  <div class="section-link"><a href="stream-sync-behavior.html#stream-sync-behavior">2.&nbsp;Stream synchronization behavior</a></div>
               </li>
               <li>
                  <div class="section-link"><a href="modules.html#modules">3.&nbsp;Modules</a></div>
                  <ul>
                     <li>
                        <div class="section-link"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES">3.1.&nbsp;Data types used by CUDA driver</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__ERROR.html#group__CUDA__ERROR">3.2.&nbsp;Error Handling</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__INITIALIZE.html#group__CUDA__INITIALIZE">3.3.&nbsp;Initialization</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__VERSION.html#group__CUDA__VERSION">3.4.&nbsp;Version Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__DEVICE.html#group__CUDA__DEVICE">3.5.&nbsp;Device Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__DEVICE__DEPRECATED.html#group__CUDA__DEVICE__DEPRECATED">3.6.&nbsp;Device Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__CTX.html#group__CUDA__CTX">3.7.&nbsp;Context Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__CTX__DEPRECATED.html#group__CUDA__CTX__DEPRECATED">3.8.&nbsp;Context Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__MODULE.html#group__CUDA__MODULE">3.9.&nbsp;Module Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__MEM.html#group__CUDA__MEM">3.10.&nbsp;Memory Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__UNIFIED.html#group__CUDA__UNIFIED">3.11.&nbsp;Unified Addressing</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__STREAM.html#group__CUDA__STREAM">3.12.&nbsp;Stream Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__EVENT.html#group__CUDA__EVENT">3.13.&nbsp;Event Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__EXEC.html#group__CUDA__EXEC">3.14.&nbsp;Execution Control</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__EXEC__DEPRECATED.html#group__CUDA__EXEC__DEPRECATED">3.15.&nbsp;Execution Control [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__OCCUPANCY.html#group__CUDA__OCCUPANCY">3.16.&nbsp;Occupancy</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__TEXREF.html#group__CUDA__TEXREF">3.17.&nbsp;Texture Reference Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__TEXREF__DEPRECATED.html#group__CUDA__TEXREF__DEPRECATED">3.18.&nbsp;Texture Reference Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__SURFREF.html#group__CUDA__SURFREF">3.19.&nbsp;Surface Reference Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__TEXOBJECT.html#group__CUDA__TEXOBJECT">3.20.&nbsp;Texture Object Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__SURFOBJECT.html#group__CUDA__SURFOBJECT">3.21.&nbsp;Surface Object Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS">3.22.&nbsp;Peer Context Memory Access</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS">3.23.&nbsp;Graphics Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__PROFILER.html#group__CUDA__PROFILER">3.24.&nbsp;Profiler Control</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__GL.html#group__CUDA__GL">3.25.&nbsp;OpenGL Interoperability</a></div>
                        <ul>
                           <li>
                              <div class="section-link"><a href="group__CUDA__GL__DEPRECATED.html#group__CUDA__GL__DEPRECATED">3.25.1.&nbsp;OpenGL Interoperability [DEPRECATED]</a></div>
                           </li>
                        </ul>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__D3D9.html#group__CUDA__D3D9">3.26.&nbsp;Direct3D 9 Interoperability</a></div>
                        <ul>
                           <li>
                              <div class="section-link"><a href="group__CUDA__D3D9__DEPRECATED.html#group__CUDA__D3D9__DEPRECATED">3.26.1.&nbsp;Direct3D 9 Interoperability [DEPRECATED]</a></div>
                           </li>
                        </ul>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__D3D10.html#group__CUDA__D3D10">3.27.&nbsp;Direct3D 10 Interoperability</a></div>
                        <ul>
                           <li>
                              <div class="section-link"><a href="group__CUDA__D3D10__DEPRECATED.html#group__CUDA__D3D10__DEPRECATED">3.27.1.&nbsp;Direct3D 10 Interoperability [DEPRECATED]</a></div>
                           </li>
                        </ul>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__D3D11.html#group__CUDA__D3D11">3.28.&nbsp;Direct3D 11 Interoperability</a></div>
                        <ul>
                           <li>
                              <div class="section-link"><a href="group__CUDA__D3D11__DEPRECATED.html#group__CUDA__D3D11__DEPRECATED">3.28.1.&nbsp;Direct3D 11 Interoperability [DEPRECATED]</a></div>
                           </li>
                        </ul>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDA__VDPAU.html#group__CUDA__VDPAU">3.29.&nbsp;VDPAU Interoperability</a></div>
                     </li>
                  </ul>
               </li>
               <li>
                  <div class="section-link"><a href="annotated.html#annotated">4.&nbsp;Data Structures</a></div>
                  <ul>
                     <li>
                        <div class="section-link"><a href="structCUDA__ARRAY3D__DESCRIPTOR.html#structCUDA__ARRAY3D__DESCRIPTOR">4.1.&nbsp;CUDA_ARRAY3D_DESCRIPTOR</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__ARRAY__DESCRIPTOR.html#structCUDA__ARRAY__DESCRIPTOR">4.2.&nbsp;CUDA_ARRAY_DESCRIPTOR</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__MEMCPY2D.html#structCUDA__MEMCPY2D">4.3.&nbsp;CUDA_MEMCPY2D</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__MEMCPY3D.html#structCUDA__MEMCPY3D">4.4.&nbsp;CUDA_MEMCPY3D</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__MEMCPY3D__PEER.html#structCUDA__MEMCPY3D__PEER">4.5.&nbsp;CUDA_MEMCPY3D_PEER</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__POINTER__ATTRIBUTE__P2P__TOKENS.html#structCUDA__POINTER__ATTRIBUTE__P2P__TOKENS">4.6.&nbsp;CUDA_POINTER_ATTRIBUTE_P2P_TOKENS</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__RESOURCE__DESC.html#structCUDA__RESOURCE__DESC">4.7.&nbsp;CUDA_RESOURCE_DESC</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__RESOURCE__VIEW__DESC.html#structCUDA__RESOURCE__VIEW__DESC">4.8.&nbsp;CUDA_RESOURCE_VIEW_DESC</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUDA__TEXTURE__DESC.html#structCUDA__TEXTURE__DESC">4.9.&nbsp;CUDA_TEXTURE_DESC</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUdevprop.html#structCUdevprop">4.10.&nbsp;CUdevprop</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUipcEventHandle.html#structCUipcEventHandle">4.11.&nbsp;CUipcEventHandle</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structCUipcMemHandle.html#structCUipcMemHandle">4.12.&nbsp;CUipcMemHandle</a></div>
                     </li>
                  </ul>
               </li>
               <li>
                  <div class="section-link"><a href="functions.html#functions">5.&nbsp;Data Fields</a></div>
               </li>
               <li>
                  <div class="section-link"><a href="deprecated.html#deprecated">6.&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__CUDA__UNIFIED.html" shape="rect">&lt; Previous</a> | <a href="group__CUDA__EVENT.html" shape="rect">Next &gt;</a></div>
               <div id="release-info">CUDA Driver API
                  (<a href="../../pdf/CUDA_Driver_API.pdf">PDF</a>)
                  -
                  
                  v6.5
                  (<a href="https://developer.nvidia.com/cuda-toolkit-archive">older</a>)
                  -
                  Last updated August 1, 2014
                  -
                  <a href="mailto:cudatools@nvidia.com?subject=CUDA Toolkit Documentation Feedback: CUDA Driver API">Send Feedback</a>
                  -
                  <span class="st_facebook"></span><span class="st_twitter"></span><span class="st_linkedin"></span><span class="st_reddit"></span><span class="st_slashdot"></span><span class="st_tumblr"></span><span class="st_sharethis"></span></div>
            </div>
            <article id="contents">
               <div class="topic reference apiRef apiPackage cppModule" id="group__CUDA__STREAM"><a name="group__CUDA__STREAM" shape="rect">
                     <!-- --></a><h2 class="topictitle2 cppModule">3.12.&nbsp;Stream Management</h2>
                  <div class="section">
                     <p>This section describes the stream management functions of the low-level CUDA driver application programming interface. </p>
                  </div>
                  <h3 class="fake_sectiontitle member_header">Functions</h3>
                  <dl class="members">
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" shape="rect">cuStreamAddCallback</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ge5743a8c48527f1040107a68205c5ba9" title="" shape="rect">CUstreamCallback</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"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g6e468d680e263e7eba02a56643c50533" shape="rect">cuStreamAttachMemAsync</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1g5e264ce2ad6a38761e7e04921ef771de" title="" shape="rect">CUdeviceptr</a><span>&nbsp;</span><span class="keyword keyword apiItemName">dptr</span>, size_t<span>&nbsp;</span><span class="keyword keyword apiItemName">length</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Attach memory to a stream asynchronously. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" shape="rect">cuStreamCreate</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">phStream</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">Flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Create a stream. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" shape="rect">cuStreamCreateWithPriority</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">phStream</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 a stream with the given priority. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" shape="rect">cuStreamDestroy</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Destroys a stream. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7" shape="rect">cuStreamGetFlags</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</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 given stream. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484" shape="rect">cuStreamGetPriority</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</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 given stream. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" shape="rect">cuStreamQuery</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Determine status of a compute stream. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" shape="rect">cuStreamSynchronize</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Wait until a stream's tasks are completed. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a>&nbsp;</span><span class="member_name"><a href="#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" shape="rect">cuStreamWaitEvent</a> (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1g6d740185cf0953636d4ae37f68d7559b" title="" shape="rect">CUevent</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hEvent</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>
                  </dl>
                  <div class="description">
                     <h3 class="sectiontitle">Functions</h3>
                     <dl class="description">
                        <dt class="description"><a name="group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" id="group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamAddCallback (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ge5743a8c48527f1040107a68205c5ba9" title="" shape="rect">CUstreamCallback</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">hStream</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__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e90fd2e63260c6317ba943af0f7e4b8d21" shape="rect">CUDA_ERROR_INVALID_HANDLE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e954756ae7ade0dfd09faeccb513dd831b" shape="rect">CUDA_ERROR_NOT_SUPPORTED</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each cuStreamAddCallback
                                 call, the 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__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</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__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" shape="rect">CUresult</a>.
                              </p>
                              <p class="p">Callbacks must not make any CUDA API calls. Attempting to use a CUDA API will result in <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9e23d0197c490ec332a43e55b167968a3" shape="rect">CUDA_ERROR_NOT_PERMITTED</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">This API requires compute capability 1.1 or greater. See <a class="xref" href="group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g9c3e1414f0ad901d3278a4d6645fc266" title="Returns information about the device." shape="rect">cuDeviceGetAttribute</a> or <a class="xref" href="group__CUDA__DEVICE__DEPRECATED.html#group__CUDA__DEVICE__DEPRECATED_1g65a5b4e25186bd257df80b98c98cffe6" title="Returns properties for a selected device." shape="rect">cuDeviceGetProperties</a> to query compute capability. Attempting to use this API with earlier compute versions will return <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e954756ae7ade0dfd09faeccb513dd831b" shape="rect">CUDA_ERROR_NOT_SUPPORTED</a>.
                              </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__null-stream" shape="rect">NULL 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>
                                    </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__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" title="Determine status of a compute stream." shape="rect">cuStreamQuery</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" title="Make a compute stream wait on an event." shape="rect">cuStreamWaitEvent</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__MEM.html#group__CUDA__MEM_1gb347ded34dc326af404aa02af5388a32" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cuMemAllocManaged</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6e468d680e263e7eba02a56643c50533" title="Attach memory to a stream asynchronously." shape="rect">cuStreamAttachMemAsync</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g6e468d680e263e7eba02a56643c50533" id="group__CUDA__STREAM_1g6e468d680e263e7eba02a56643c50533" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamAttachMemAsync (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1g5e264ce2ad6a38761e7e04921ef771de" title="" shape="rect">CUdeviceptr</a><span>&nbsp;</span><span class="keyword keyword apiItemName">dptr</span>, size_t<span>&nbsp;</span><span class="keyword keyword apiItemName">length</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</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">hStream</span></tt></dt>
                                 <dd>- Stream in which to enqueue the attach operation </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">dptr</span></tt></dt>
                                 <dd>- Pointer to memory (must be a pointer to managed memory) </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">length</span></tt></dt>
                                 <dd>- Length of memory (must be 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__CUDA__TYPES.html#group__CUDA__TYPES_1g17c5d5f9b585aa2d6f121847d1a78f4c" shape="rect">CUmemAttach_flags</a></dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e90fd2e63260c6317ba943af0f7e4b8d21" shape="rect">CUDA_ERROR_INVALID_HANDLE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e954756ae7ade0dfd09faeccb513dd831b" shape="rect">CUDA_ERROR_NOT_SUPPORTED</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Enqueues an operation in <tt class="ph tt code">hStream</tt> to specify stream association of <tt class="ph tt code">length</tt> bytes of memory starting from <tt class="ph tt code">dptr</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">dptr</tt> must point to an address within managed memory space declared using the __managed__ keyword or allocated with <a class="xref" href="group__CUDA__MEM.html#group__CUDA__MEM_1gb347ded34dc326af404aa02af5388a32" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cuMemAllocManaged</a>.
                              </p>
                              <p class="p"><tt class="ph tt code">length</tt> must be zero, to indicate that the entire allocation's stream association is being changed. Currently, it's not possible
                                 to change stream association for a portion of an allocation.
                              </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__CUDA__TYPES.html#group__CUDA__TYPES_1g17c5d5f9b585aa2d6f121847d1a78f4c" shape="rect">CUmemAttach_flags</a>. If the <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gg17c5d5f9b585aa2d6f121847d1a78f4c0b42aae6a29b41b734d4c0dea6c33313" shape="rect">CU_MEM_ATTACH_GLOBAL</a> flag is specified, the memory can be accessed by any stream on any device. If the <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gg17c5d5f9b585aa2d6f121847d1a78f4c8b59c62cab9c7a762338e5fae92e2e9c" shape="rect">CU_MEM_ATTACH_HOST</a> flag is specified, the program makes a guarantee that it won't access the memory on the device from any stream. If the <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gg17c5d5f9b585aa2d6f121847d1a78f4c4b70b6a5e039f61eccc6b8db3dfac442" shape="rect">CU_MEM_ATTACH_SINGLE</a> flag is specified, the program makes a guarantee that it will only access the memory on the device from <tt class="ph tt code">hStream</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">hStream</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__CUDA__STREAM.html#group__CUDA__STREAM_1g6e468d680e263e7eba02a56643c50533" title="Attach memory to a stream asynchronously." shape="rect">cuStreamAttachMemAsync</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">hStream</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__CUDA__MEM.html#group__CUDA__MEM_1gb347ded34dc326af404aa02af5388a32" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cuMemAllocManaged</a>. For __managed__ variables, the default association is always <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gg17c5d5f9b585aa2d6f121847d1a78f4c0b42aae6a29b41b734d4c0dea6c33313" shape="rect">CU_MEM_ATTACH_GLOBAL</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">This function uses standard  <a class="xref xmlonly" href="stream-sync-behavior.html#stream-sync-behavior__null-stream" shape="rect">NULL 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>
                                    </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__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" title="Determine status of a compute stream." shape="rect">cuStreamQuery</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" title="Make a compute stream wait on an event." shape="rect">cuStreamWaitEvent</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__MEM.html#group__CUDA__MEM_1gb347ded34dc326af404aa02af5388a32" title="Allocates memory that will be automatically managed by the Unified Memory system." shape="rect">cuMemAllocManaged</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" id="group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamCreate (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">phStream</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">Flags</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Create 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">phStream</span></tt></dt>
                                 <dd>- Returned newly created stream </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__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e990696c86fcee1f536a1ec7d25867feeb" shape="rect">CUDA_ERROR_INVALID_VALUE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9264c50688ed110e8476b591befe60c02" shape="rect">CUDA_ERROR_OUT_OF_MEMORY</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Creates a stream and returns a handle in <tt class="ph tt code">phStream</tt>. The <tt class="ph tt code">Flags</tt> argument determines 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__CUDA__TYPES.html#group__CUDA__TYPES_1gg775cb4ffbb7adf91e190067d9ad1752aaa5df0ec96f491f1be1124fdf265a066" shape="rect">CU_STREAM_DEFAULT</a>: Default stream creation flag.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gg775cb4ffbb7adf91e190067d9ad1752a89727d1d315214a6301abe98b419aff6" shape="rect">CU_STREAM_NON_BLOCKING</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><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__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" title="Create a stream with the given priority." shape="rect">cuStreamCreateWithPriority</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484" title="Query the priority of a given stream." shape="rect">cuStreamGetPriority</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7" title="Query the flags of a given stream." shape="rect">cuStreamGetFlags</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" title="Make a compute stream wait on an event." shape="rect">cuStreamWaitEvent</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" title="Determine status of a compute stream." shape="rect">cuStreamQuery</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" title="Add a callback to a compute stream." shape="rect">cuStreamAddCallback</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" id="group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamCreateWithPriority (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a>*<span>&nbsp;</span><span class="keyword keyword apiItemName">phStream</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 a stream with the given 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">phStream</span></tt></dt>
                                 <dd>- Returned newly created stream </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__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a> for a list of valid flags 
                                 </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">priority</span></tt></dt>
                                 <dd>- Stream priority. Lower numbers represent higher priorities. See <a class="xref" href="group__CUDA__CTX.html#group__CUDA__CTX_1g137920ab61a71be6ce67605b9f294091" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cuCtxGetStreamPriorityRange</a> for more information about 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__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e990696c86fcee1f536a1ec7d25867feeb" shape="rect">CUDA_ERROR_INVALID_VALUE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9264c50688ed110e8476b591befe60c02" shape="rect">CUDA_ERROR_OUT_OF_MEMORY</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">phStream</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__CUDA__CTX.html#group__CUDA__CTX_1g137920ab61a71be6ce67605b9f294091" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cuCtxGetStreamPriorityRange</a>. If the specified priority is outside the numerical range returned by <a class="xref" href="group__CUDA__CTX.html#group__CUDA__CTX_1g137920ab61a71be6ce67605b9f294091" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cuCtxGetStreamPriorityRange</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">Stream priorities are supported only on Quadro and Tesla 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__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484" title="Query the priority of a given stream." shape="rect">cuStreamGetPriority</a>, <a class="xref" href="group__CUDA__CTX.html#group__CUDA__CTX_1g137920ab61a71be6ce67605b9f294091" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cuCtxGetStreamPriorityRange</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7" title="Query the flags of a given stream." shape="rect">cuStreamGetFlags</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" title="Make a compute stream wait on an event." shape="rect">cuStreamWaitEvent</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" title="Determine status of a compute stream." shape="rect">cuStreamQuery</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" title="Add a callback to a compute stream." shape="rect">cuStreamAddCallback</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" id="group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamDestroy (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Destroys 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>- Stream to destroy</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e990696c86fcee1f536a1ec7d25867feeb" shape="rect">CUDA_ERROR_INVALID_VALUE</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Destroys the stream specified by <tt class="ph tt code">hStream</tt>.
                              </p>
                              <p class="p">In case the device is still doing work in the stream <tt class="ph tt code">hStream</tt> when <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy()</a> is called, the function will return immediately and the resources associated with <tt class="ph tt code">hStream</tt> will be released automatically once the device has completed all work in <tt class="ph tt code">hStream</tt>.
                              </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__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" title="Make a compute stream wait on an event." shape="rect">cuStreamWaitEvent</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" title="Determine status of a compute stream." shape="rect">cuStreamQuery</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" title="Add a callback to a compute stream." shape="rect">cuStreamAddCallback</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7" id="group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamGetFlags (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</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 given 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 The value returned in <tt class="ph tt code">flags</tt> is a logical 'OR' of all flags that were used while creating this stream. See <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a> for the list of valid flags 
                                 </dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e990696c86fcee1f536a1ec7d25867feeb" shape="rect">CUDA_ERROR_INVALID_VALUE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e90fd2e63260c6317ba943af0f7e4b8d21" shape="rect">CUDA_ERROR_INVALID_HANDLE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9264c50688ed110e8476b591befe60c02" shape="rect">CUDA_ERROR_OUT_OF_MEMORY</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Query the flags of a stream created using <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a> or <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" title="Create a stream with the given priority." shape="rect">cuStreamCreateWithPriority</a> and return the flags in <tt class="ph tt code">flags</tt>.
                              </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__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484" title="Query the priority of a given stream." shape="rect">cuStreamGetPriority</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484" id="group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamGetPriority (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</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 given 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__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e990696c86fcee1f536a1ec7d25867feeb" shape="rect">CUDA_ERROR_INVALID_VALUE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e90fd2e63260c6317ba943af0f7e4b8d21" shape="rect">CUDA_ERROR_INVALID_HANDLE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9264c50688ed110e8476b591befe60c02" shape="rect">CUDA_ERROR_OUT_OF_MEMORY</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Query the priority of a stream created using <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a> or <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" title="Create a stream with the given priority." shape="rect">cuStreamCreateWithPriority</a> and return the priority in <tt class="ph tt code">priority</tt>. Note that if the stream was created with a priority outside the numerical range returned by <a class="xref" href="group__CUDA__CTX.html#group__CUDA__CTX_1g137920ab61a71be6ce67605b9f294091" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cuCtxGetStreamPriorityRange</a>, this function returns the clamped priority. See <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" title="Create a stream with the given priority." shape="rect">cuStreamCreateWithPriority</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><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__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471" title="Create a stream with the given priority." shape="rect">cuStreamCreateWithPriority</a>, <a class="xref" href="group__CUDA__CTX.html#group__CUDA__CTX_1g137920ab61a71be6ce67605b9f294091" title="Returns numerical values that correspond to the least and greatest stream priorities." shape="rect">cuCtxGetStreamPriorityRange</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7" title="Query the flags of a given stream." shape="rect">cuStreamGetFlags</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" id="group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamQuery (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Determine status of 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">hStream</span></tt></dt>
                                 <dd>- Stream to query status of</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e90fd2e63260c6317ba943af0f7e4b8d21" shape="rect">CUDA_ERROR_INVALID_HANDLE</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9edd9cef666ce620352e619a36b6c3f34" shape="rect">CUDA_ERROR_NOT_READY</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Returns <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a> if all operations in the stream specified by <tt class="ph tt code">hStream</tt> have completed, or <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9edd9cef666ce620352e619a36b6c3f34" shape="rect">CUDA_ERROR_NOT_READY</a> if not.
                              </p>
                              <p class="p">For the purposes of Unified Memory, a return value of <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a> is equivalent to having called <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize()</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__null-stream" shape="rect">NULL 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>
                                    </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__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" title="Make a compute stream wait on an event." shape="rect">cuStreamWaitEvent</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" title="Add a callback to a compute stream." shape="rect">cuStreamAddCallback</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" id="group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamSynchronize (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Wait until a stream's tasks are completed. </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>- Stream to wait for</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e90fd2e63260c6317ba943af0f7e4b8d21" shape="rect">CUDA_ERROR_INVALID_HANDLE</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Waits until the device has completed all operations in the stream specified by <tt class="ph tt code">hStream</tt>. If the context was created with the <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gg9f889e28a45a295b5c8ce13aa05f6cd462aebfe6432ade3feb32f1a409027852" shape="rect">CU_CTX_SCHED_BLOCKING_SYNC</a> flag, the CPU 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__null-stream" shape="rect">NULL 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>
                                    </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__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" title="Make a compute stream wait on an event." shape="rect">cuStreamWaitEvent</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" title="Determine status of a compute stream." shape="rect">cuStreamQuery</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" title="Add a callback to a compute stream." shape="rect">cuStreamAddCallback</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" id="group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f" shape="rect">
                              <!-- --></a><span><a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gc6c391505e117393cc2558fff6bfc2e9" title="" shape="rect">CUresult</a> cuStreamWaitEvent (  <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1gb946c7f02e09efd788a204718015d88a" title="" shape="rect">CUstream</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hStream</span>, <a href="group__CUDA__TYPES.html#group__CUDA__TYPES_1g6d740185cf0953636d4ae37f68d7559b" title="" shape="rect">CUevent</a><span>&nbsp;</span><span class="keyword keyword apiItemName">hEvent</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">hStream</span></tt></dt>
                                 <dd>- Stream to wait </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">hEvent</span></tt></dt>
                                 <dd>- Event to wait on (may not be NULL) </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__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d" shape="rect">CUDA_SUCCESS</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9acf52f132faf29b473cdda6061f0f44a" shape="rect">CUDA_ERROR_DEINITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e98feb999f0af99b4a25ab26b3866f4df8" shape="rect">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a484e9af32c1e9893ff21f0e0191a12d" shape="rect">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="xref" href="group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e90fd2e63260c6317ba943af0f7e4b8d21" shape="rect">CUDA_ERROR_INVALID_HANDLE</a>, 
                              </p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Makes all future work submitted to <tt class="ph tt code">hStream</tt> wait until <tt class="ph tt code">hEvent</tt> reports completion before beginning execution. This synchronization will be performed efficiently on the device. The event
                                 <tt class="ph tt code">hEvent</tt> may be from a different context than <tt class="ph tt code">hStream</tt>, in which case this function will perform cross-device synchronization.
                              </p>
                              <p class="p">The stream <tt class="ph tt code">hStream</tt> will wait only for the completion of the most recent host call to <a class="xref" href="group__CUDA__EVENT.html#group__CUDA__EVENT_1g95424d3be52c4eb95d83861b70fb89d1" title="Records an event." shape="rect">cuEventRecord()</a> on <tt class="ph tt code">hEvent</tt>. Once this call has returned, any functions (including <a class="xref" href="group__CUDA__EVENT.html#group__CUDA__EVENT_1g95424d3be52c4eb95d83861b70fb89d1" title="Records an event." shape="rect">cuEventRecord()</a> and <a class="xref" href="group__CUDA__EVENT.html#group__CUDA__EVENT_1g593ec73a8ec5a5fc031311d3e4dca1ef" title="Destroys an event." shape="rect">cuEventDestroy()</a>) may be called on <tt class="ph tt code">hEvent</tt> again, and subsequent calls will not have any effect on <tt class="ph tt code">hStream</tt>.
                              </p>
                              <p class="p">If <a class="xref" href="group__CUDA__EVENT.html#group__CUDA__EVENT_1g95424d3be52c4eb95d83861b70fb89d1" title="Records an event." shape="rect">cuEventRecord()</a> has not been called on <tt class="ph tt code">hEvent</tt>, this call acts as if the record has already completed, and so is a functional no-op.
                              </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__null-stream" shape="rect">NULL 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>
                                    </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__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4" title="Create a stream." shape="rect">cuStreamCreate</a>, <a class="xref" href="group__CUDA__EVENT.html#group__CUDA__EVENT_1g95424d3be52c4eb95d83861b70fb89d1" title="Records an event." shape="rect">cuEventRecord</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b" title="Determine status of a compute stream." shape="rect">cuStreamQuery</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad" title="Wait until a stream's tasks are completed." shape="rect">cuStreamSynchronize</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483" title="Add a callback to a compute stream." shape="rect">cuStreamAddCallback</a>, <a class="xref" href="group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758" title="Destroys a stream." shape="rect">cuStreamDestroy</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></body>
</html>