Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > nonfree-updates > by-pkgid > fd8445e7e4d58b8cfe6e0150bd441ee1 > files > 1161

nvidia-cuda-toolkit-devel-6.5.14-6.1.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="OpenGL Interoperability"></meta>
      <meta name="abstract" content=""></meta>
      <meta name="description" content=""></meta>
      <meta name="DC.Format" content="XHTML"></meta>
      <meta name="DC.Identifier" content="group__CUDART__OPENGL"></meta>
      <link rel="stylesheet" type="text/css" href="../common/formatting/commonltr.css"></link>
      <link rel="stylesheet" type="text/css" href="../common/formatting/site.css"></link>
      <title>CUDA Runtime API :: CUDA Toolkit Documentation</title>
      <!--[if lt IE 9]>
      <script src="../common/formatting/html5shiv-printshiv.min.js"></script>
      <![endif]-->
      <script type="text/javascript" charset="utf-8" src="../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-runtime-api/index.html"></link>
      <link rel="stylesheet" type="text/css" href="../common/formatting/qwcode.highlight.css"></link>
   </head>
   <body>
      
      <header id="header"><span id="company">NVIDIA</span><span id="site-title">CUDA Toolkit Documentation</span><form id="search" method="get" action="search">
            <input type="text" name="search-text"></input><fieldset id="search-location">
               <legend>Search In:</legend>
               <label><input type="radio" name="search-type" value="site"></input>Entire Site</label>
               <label><input type="radio" name="search-type" value="document"></input>Just This Document</label></fieldset>
            <button type="reset">clear search</button>
            <button id="submit" type="submit">search</button></form>
      </header>
      <div id="site-content">
         <nav id="site-nav">
            <div class="category closed"><a href="../index.html" title="The root of the site.">CUDA Toolkit
                  v6.5</a></div>
            <div class="category"><a href="index.html" title="CUDA Runtime API">CUDA Runtime API</a></div>
            <ul>
               <li>
                  <div class="section-link"><a href="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__CUDART__DEVICE.html#group__CUDART__DEVICE">3.1.&nbsp;Device Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__THREAD__DEPRECATED.html#group__CUDART__THREAD__DEPRECATED">3.2.&nbsp;Thread Management [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__ERROR.html#group__CUDART__ERROR">3.3.&nbsp;Error Handling</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__STREAM.html#group__CUDART__STREAM">3.4.&nbsp;Stream Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__EVENT.html#group__CUDART__EVENT">3.5.&nbsp;Event Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__EXECUTION.html#group__CUDART__EXECUTION">3.6.&nbsp;Execution Control</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__OCCUPANCY.html#group__CUDART__OCCUPANCY">3.7.&nbsp;Occupancy</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__MEMORY.html#group__CUDART__MEMORY">3.8.&nbsp;Memory Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__UNIFIED.html#group__CUDART__UNIFIED">3.9.&nbsp;Unified Addressing</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__PEER.html#group__CUDART__PEER">3.10.&nbsp;Peer Device Memory Access</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__OPENGL.html#group__CUDART__OPENGL">3.11.&nbsp;OpenGL Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__OPENGL__DEPRECATED.html#group__CUDART__OPENGL__DEPRECATED">3.12.&nbsp;OpenGL Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D9.html#group__CUDART__D3D9">3.13.&nbsp;Direct3D 9 Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D9__DEPRECATED.html#group__CUDART__D3D9__DEPRECATED">3.14.&nbsp;Direct3D 9 Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D10.html#group__CUDART__D3D10">3.15.&nbsp;Direct3D 10 Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D10__DEPRECATED.html#group__CUDART__D3D10__DEPRECATED">3.16.&nbsp;Direct3D 10 Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D11.html#group__CUDART__D3D11">3.17.&nbsp;Direct3D 11 Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__D3D11__DEPRECATED.html#group__CUDART__D3D11__DEPRECATED">3.18.&nbsp;Direct3D 11 Interoperability [DEPRECATED]</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__VDPAU.html#group__CUDART__VDPAU">3.19.&nbsp;VDPAU Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__INTEROP.html#group__CUDART__INTEROP">3.20.&nbsp;Graphics Interoperability</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__TEXTURE.html#group__CUDART__TEXTURE">3.21.&nbsp;Texture Reference Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__SURFACE.html#group__CUDART__SURFACE">3.22.&nbsp;Surface Reference Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT">3.23.&nbsp;Texture Object Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__SURFACE__OBJECT.html#group__CUDART__SURFACE__OBJECT">3.24.&nbsp;Surface Object Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART____VERSION.html#group__CUDART____VERSION">3.25.&nbsp;Version Management</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL">3.26.&nbsp;C++ API Routines</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__DRIVER.html#group__CUDART__DRIVER">3.27.&nbsp;Interactions with the CUDA Driver API</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__PROFILER.html#group__CUDART__PROFILER">3.28.&nbsp;Profiler Control</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="group__CUDART__TYPES.html#group__CUDART__TYPES">3.29.&nbsp;Data types used by CUDA Runtime</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="class____cudaOccupancyB2DHelper.html#class____cudaOccupancyB2DHelper">4.1.&nbsp;__cudaOccupancyB2DHelper</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaChannelFormatDesc.html#structcudaChannelFormatDesc">4.2.&nbsp;cudaChannelFormatDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaDeviceProp.html#structcudaDeviceProp">4.3.&nbsp;cudaDeviceProp</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaExtent.html#structcudaExtent">4.4.&nbsp;cudaExtent</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaFuncAttributes.html#structcudaFuncAttributes">4.5.&nbsp;cudaFuncAttributes</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaIpcEventHandle__t.html#structcudaIpcEventHandle__t">4.6.&nbsp;cudaIpcEventHandle_t</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaIpcMemHandle__t.html#structcudaIpcMemHandle__t">4.7.&nbsp;cudaIpcMemHandle_t</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaMemcpy3DParms.html#structcudaMemcpy3DParms">4.8.&nbsp;cudaMemcpy3DParms</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaMemcpy3DPeerParms.html#structcudaMemcpy3DPeerParms">4.9.&nbsp;cudaMemcpy3DPeerParms</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaPitchedPtr.html#structcudaPitchedPtr">4.10.&nbsp;cudaPitchedPtr</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaPointerAttributes.html#structcudaPointerAttributes">4.11.&nbsp;cudaPointerAttributes</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaPos.html#structcudaPos">4.12.&nbsp;cudaPos</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaResourceDesc.html#structcudaResourceDesc">4.13.&nbsp;cudaResourceDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaResourceViewDesc.html#structcudaResourceViewDesc">4.14.&nbsp;cudaResourceViewDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structcudaTextureDesc.html#structcudaTextureDesc">4.15.&nbsp;cudaTextureDesc</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structsurfaceReference.html#structsurfaceReference">4.16.&nbsp;surfaceReference</a></div>
                     </li>
                     <li>
                        <div class="section-link"><a href="structtextureReference.html#structtextureReference">4.17.&nbsp;textureReference</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__CUDART__PEER.html" shape="rect">&lt; Previous</a> | <a href="group__CUDART__OPENGL__DEPRECATED.html" shape="rect">Next &gt;</a></div>
               <div id="release-info">CUDA Runtime API
                  (<a href="../../pdf/CUDA_Runtime_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 Runtime 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__CUDART__OPENGL"><a name="group__CUDART__OPENGL" shape="rect">
                     <!-- --></a><h2 class="topictitle2 cppModule">3.11.&nbsp;OpenGL Interoperability</h2>
                  <div class="section">
                     <p>This section describes the OpenGL interoperability functions of the CUDA runtime application programming interface. Note that
                        mapping of OpenGL resources is performed with the graphics API agnostic, resource mapping interface described in <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP" shape="rect">Graphics Interopability</a>. 
                     </p>
                  </div>
                  <h3 class="fake_sectiontitle member_header">Enumerations</h3>
                  <dl class="members">
                     <dt><span class="member_type">enum&nbsp;</span><span class="member_name"><a href="#group__CUDART__OPENGL_1gb16c58ea3958e29c9b15cad8e5b03969" shape="rect">cudaGLDeviceList</a></span></dt>
                     <dd class="shortdesc"><span></span><span class="desc"></span></dd>
                  </dl>
                  <h3 class="fake_sectiontitle member_header">Functions</h3>
                  <dl class="members">
                     <dt><span class="member_type"><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__OPENGL_1gcf14c650f5659b66aa7d9f3099ae5ade" shape="rect">cudaGLGetDevices</a> (  unsigned int*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCudaDeviceCount</span>, int*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCudaDevices</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">cudaDeviceCount</span>, <a href="group__CUDART__OPENGL.html#group__CUDART__OPENGL_1gb16c58ea3958e29c9b15cad8e5b03969" title="" shape="rect">cudaGLDeviceList</a><span>&nbsp;</span><span class="keyword keyword apiItemName">deviceList</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Gets the CUDA devices associated with the current OpenGL context. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__OPENGL_1g43f69a041bdfa4f8b36aff99bf0171db" shape="rect">cudaGraphicsGLRegisterBuffer</a> (  cudaGraphicsResource**<span>&nbsp;</span><span class="keyword keyword apiItemName">resource</span>, GLuint<span>&nbsp;</span><span class="keyword keyword apiItemName">buffer</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Registers an OpenGL buffer object. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__OPENGL_1gd7be3ca8a7a739d57f0b558562c5706e" shape="rect">cudaGraphicsGLRegisterImage</a> (  cudaGraphicsResource**<span>&nbsp;</span><span class="keyword keyword apiItemName">resource</span>, GLuint<span>&nbsp;</span><span class="keyword keyword apiItemName">image</span>, GLenum<span>&nbsp;</span><span class="keyword keyword apiItemName">target</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Register an OpenGL texture or renderbuffer object. </span></dd>
                     <dt><span class="member_type"><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a>&nbsp;</span><span class="member_name"><a href="#group__CUDART__OPENGL_1ga48bc83e2aeff82904589243a11b5e09" shape="rect">cudaWGLGetDevice</a> (  int*<span>&nbsp;</span><span class="keyword keyword apiItemName">device</span>, HGPUNV<span>&nbsp;</span><span class="keyword keyword apiItemName">hGpu</span> ) </span></dt>
                     <dd class="shortdesc"><span></span><span class="desc">Gets the CUDA device associated with hGpu. </span></dd>
                  </dl>
                  <div class="description">
                     <h3 class="sectiontitle">Enumerations</h3>
                     <dl class="description">
                        <dt class="description"><a name="group__CUDART__OPENGL_1gb16c58ea3958e29c9b15cad8e5b03969" id="group__CUDART__OPENGL_1gb16c58ea3958e29c9b15cad8e5b03969" shape="rect">
                              <!-- --></a><span>enum cudaGLDeviceList</span></dt>
                        <dd class="description">
                           <div class="section">
                              <p>CUDA devices corresponding to the current OpenGL context </p>
                           </div>
                           <div class="enum-members">
                              <h6 class="enumerator_header">
                                 Values
                                 
                              </h6>
                              <dl class="enumerator">
                                 <dt><span class="enum-member-name-def">cudaGLDeviceListAll = <span class="ph ph apiData">1</span></span></dt>
                                 <dd>The CUDA devices for all GPUs used by the current OpenGL context </dd>
                                 <dt><span class="enum-member-name-def">cudaGLDeviceListCurrentFrame = <span class="ph ph apiData">2</span></span></dt>
                                 <dd>The CUDA devices for the GPUs used by the current OpenGL context in its currently rendering frame </dd>
                                 <dt><span class="enum-member-name-def">cudaGLDeviceListNextFrame = <span class="ph ph apiData">3</span></span></dt>
                                 <dd>The CUDA devices for the GPUs to be used by the current OpenGL context in the next frame </dd>
                              </dl>
                           </div>
                        </dd>
                     </dl>
                  </div>
                  <div class="description">
                     <h3 class="sectiontitle">Functions</h3>
                     <dl class="description">
                        <dt class="description"><a name="group__CUDART__OPENGL_1gcf14c650f5659b66aa7d9f3099ae5ade" id="group__CUDART__OPENGL_1gcf14c650f5659b66aa7d9f3099ae5ade" shape="rect">
                              <!-- --></a><span><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaGLGetDevices (  unsigned int*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCudaDeviceCount</span>, int*<span>&nbsp;</span><span class="keyword keyword apiItemName">pCudaDevices</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">cudaDeviceCount</span>, <a href="group__CUDART__OPENGL.html#group__CUDART__OPENGL_1gb16c58ea3958e29c9b15cad8e5b03969" title="" shape="rect">cudaGLDeviceList</a><span>&nbsp;</span><span class="keyword keyword apiItemName">deviceList</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Gets the CUDA devices associated with the current OpenGL context. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pCudaDeviceCount</span></tt></dt>
                                 <dd>- Returned number of CUDA devices corresponding to the current OpenGL context </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">pCudaDevices</span></tt></dt>
                                 <dd>- Returned CUDA devices corresponding to the current OpenGL context </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">cudaDeviceCount</span></tt></dt>
                                 <dd>- The size of the output device array <tt class="ph tt code">pCudaDevices</tt></dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">deviceList</span></tt></dt>
                                 <dd>- The set of devices to return. This set may be <a class="xref" href="group__CUDART__OPENGL.html#group__CUDART__OPENGL_1ggb16c58ea3958e29c9b15cad8e5b03969b1031844a49f8a68bc2c094038698a57" shape="rect">cudaGLDeviceListAll</a> for all devices, <a class="xref" href="group__CUDART__OPENGL.html#group__CUDART__OPENGL_1ggb16c58ea3958e29c9b15cad8e5b03969d9d4e71110c181530d30f573503c47f4" shape="rect">cudaGLDeviceListCurrentFrame</a> for the devices used to render the current frame (in SLI), or <a class="xref" href="group__CUDART__OPENGL.html#group__CUDART__OPENGL_1ggb16c58ea3958e29c9b15cad8e5b039691662f007efc147b77a9fe6ff58b58c1e" shape="rect">cudaGLDeviceListNextFrame</a> for the devices used to render the next frame (in SLI).
                                 </dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c" shape="rect">cudaErrorUnknown</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Returns in <tt class="ph tt code">*pCudaDeviceCount</tt> the number of CUDA-compatible devices corresponding to the current OpenGL context. Also returns in <tt class="ph tt code">*pCudaDevices</tt> at most <tt class="ph tt code">cudaDeviceCount</tt> of the CUDA-compatible devices corresponding to the current OpenGL context. If any of the GPUs being used by the current
                                 OpenGL context are not CUDA capable then the call will return <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613" shape="rect">cudaErrorNoDevice</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 is not supported on Mac OS X. </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__CUDART__INTEROP.html#group__CUDART__INTEROP_1g1d45ac44d1affe17fb356e0b7a0b0560" title="Unregisters a graphics resource for access by CUDA." shape="rect">cudaGraphicsUnregisterResource</a>, <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1gb7064fb72e54d89d0666e192b45d35cc" title="Map graphics resources for access by CUDA." shape="rect">cudaGraphicsMapResources</a>, <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1gfc796cc80e7a054b13d90afde659546e" title="Get an array through which to access a subresource of a mapped graphics resource." shape="rect">cudaGraphicsSubResourceGetMappedArray</a>, <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1ge7f893864a3d38a630e71a99f5a4e17f" title="Get an device pointer through which to access a mapped graphics resource." shape="rect">cudaGraphicsResourceGetMappedPointer</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__OPENGL_1g43f69a041bdfa4f8b36aff99bf0171db" id="group__CUDART__OPENGL_1g43f69a041bdfa4f8b36aff99bf0171db" shape="rect">
                              <!-- --></a><span><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaGraphicsGLRegisterBuffer (  cudaGraphicsResource**<span>&nbsp;</span><span class="keyword keyword apiItemName">resource</span>, GLuint<span>&nbsp;</span><span class="keyword keyword apiItemName">buffer</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Registers an OpenGL buffer object. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">resource</span></tt></dt>
                                 <dd>- Pointer to the returned object handle </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">buffer</span></tt></dt>
                                 <dd>- name of buffer object to be registered </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Register flags</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a" shape="rect">cudaErrorInvalidDevice</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c" shape="rect">cudaErrorUnknown</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Registers the buffer object specified by <tt class="ph tt code">buffer</tt> for access by CUDA. A handle to the registered object is returned as <tt class="ph tt code">resource</tt>. The register flags <tt class="ph tt code">flags</tt> specify the intended usage, as follows:
                              </p>
                              <p class="p">
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c277540ff4c59c6782d5bd5a5c7d1534df19" shape="rect">cudaGraphicsRegisterFlagsNone</a>: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and
                                          written to by CUDA. This is the default value.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c277f0d4f60ed6cd732dce5522dcc6252a06" shape="rect">cudaGraphicsRegisterFlagsReadOnly</a>: Specifies that CUDA will not write to this resource.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c2778dccc1b266c4fb93d52219bab1fb6fb0" shape="rect">cudaGraphicsRegisterFlagsWriteDiscard</a>: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of
                                          the data previously stored in the resource will be preserved.
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Note that this function may also return error codes from previous, asynchronous launches.</p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1g1d45ac44d1affe17fb356e0b7a0b0560" title="Unregisters a graphics resource for access by CUDA." shape="rect">cudaGraphicsUnregisterResource</a>, <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1gb7064fb72e54d89d0666e192b45d35cc" title="Map graphics resources for access by CUDA." shape="rect">cudaGraphicsMapResources</a>, <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1ge7f893864a3d38a630e71a99f5a4e17f" title="Get an device pointer through which to access a mapped graphics resource." shape="rect">cudaGraphicsResourceGetMappedPointer</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__OPENGL_1gd7be3ca8a7a739d57f0b558562c5706e" id="group__CUDART__OPENGL_1gd7be3ca8a7a739d57f0b558562c5706e" shape="rect">
                              <!-- --></a><span><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaGraphicsGLRegisterImage (  cudaGraphicsResource**<span>&nbsp;</span><span class="keyword keyword apiItemName">resource</span>, GLuint<span>&nbsp;</span><span class="keyword keyword apiItemName">image</span>, GLenum<span>&nbsp;</span><span class="keyword keyword apiItemName">target</span>, unsigned int <span>&nbsp;</span><span class="keyword keyword apiItemName">flags</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Register an OpenGL texture or renderbuffer object. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">resource</span></tt></dt>
                                 <dd>- Pointer to the returned object handle </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">image</span></tt></dt>
                                 <dd>- name of texture or renderbuffer object to be registered </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">target</span></tt></dt>
                                 <dd>- Identifies the type of object specified by <tt class="ph tt code">image</tt></dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">flags</span></tt></dt>
                                 <dd>- Register flags</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a" shape="rect">cudaErrorInvalidDevice</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c" shape="rect">cudaErrorInvalidValue</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273" shape="rect">cudaErrorInvalidResourceHandle</a>, <a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c" shape="rect">cudaErrorUnknown</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Registers the texture or renderbuffer object specified by <tt class="ph tt code">image</tt> for access by CUDA. A handle to the registered object is returned as <tt class="ph tt code">resource</tt>.
                              </p>
                              <p class="p"><tt class="ph tt code">target</tt> must match the type of the object, and must be one of GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE, GL_TEXTURE_CUBE_MAP, GL_TEXTURE_3D,
                                 GL_TEXTURE_2D_ARRAY, or GL_RENDERBUFFER.
                              </p>
                              <p class="p">The register flags <tt class="ph tt code">flags</tt> specify the intended usage, as follows:
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c277540ff4c59c6782d5bd5a5c7d1534df19" shape="rect">cudaGraphicsRegisterFlagsNone</a>: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and
                                          written to by CUDA. This is the default value.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c277f0d4f60ed6cd732dce5522dcc6252a06" shape="rect">cudaGraphicsRegisterFlagsReadOnly</a>: Specifies that CUDA will not write to this resource.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c2778dccc1b266c4fb93d52219bab1fb6fb0" shape="rect">cudaGraphicsRegisterFlagsWriteDiscard</a>: Specifies that CUDA will not read from this resource and will write over the entire contents of the resource, so none of
                                          the data previously stored in the resource will be preserved.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c2775e6fe684d912bce0098e86e4463a5e85" shape="rect">cudaGraphicsRegisterFlagsSurfaceLoadStore</a>: Specifies that CUDA will bind this resource to a surface reference.
                                       </p>
                                    </li>
                                    <li class="li">
                                       <p class="p"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1ggd17cc29b28205bbe32ac575eba16c277bdb2f88d1ead2a284634cf3fc63be116" shape="rect">cudaGraphicsRegisterFlagsTextureGather</a>: Specifies that CUDA will perform texture gather operations on this resource.
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p">The following image formats are supported. For brevity's sake, the list is abbreviated. For ex., {GL_R, GL_RG} X {8, 16} would
                                 expand to the following 4 formats {GL_R8, GL_R16, GL_RG8, GL_RG16} :
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p">GL_RED, GL_RG, GL_RGBA, GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY</p>
                                    </li>
                                    <li class="li">
                                       <p class="p">{GL_R, GL_RG, GL_RGBA} X {8, 16, 16F, 32F, 8UI, 16UI, 32UI, 8I, 16I, 32I}</p>
                                    </li>
                                    <li class="li">
                                       <p class="p">{GL_LUMINANCE, GL_ALPHA, GL_LUMINANCE_ALPHA, GL_INTENSITY} X {8, 16, 16F_ARB, 32F_ARB, 8UI_EXT, 16UI_EXT, 32UI_EXT, 8I_EXT,
                                          16I_EXT, 32I_EXT}
                                       </p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p">The following image classes are currently disallowed:
                                 <ul class="ul">
                                    <li class="li">
                                       <p class="p">Textures with borders</p>
                                    </li>
                                    <li class="li">
                                       <p class="p">Multisampled renderbuffers</p>
                                    </li>
                                 </ul>
                              </p>
                              <p class="p"></p>
                              <p class="p"></p>
                              <p class="p">
                                 <div class="note note"><span class="notetitle">Note:</span><p class="p">Note that this function may also return error codes from previous, asynchronous launches.</p>
                                 </div>
                              </p>
                              <p class="p"></p>
                              <p class="p apiDesc_subtitle"><strong class="ph b">See also:</strong></p>
                              <p class="p see_subsection"><a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1g1d45ac44d1affe17fb356e0b7a0b0560" title="Unregisters a graphics resource for access by CUDA." shape="rect">cudaGraphicsUnregisterResource</a>, <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1gb7064fb72e54d89d0666e192b45d35cc" title="Map graphics resources for access by CUDA." shape="rect">cudaGraphicsMapResources</a>, <a class="xref" href="group__CUDART__INTEROP.html#group__CUDART__INTEROP_1gfc796cc80e7a054b13d90afde659546e" title="Get an array through which to access a subresource of a mapped graphics resource." shape="rect">cudaGraphicsSubResourceGetMappedArray</a></p>
                              <p class="p"></p>
                           </div>
                        </dd>
                        <dt class="description"><a name="group__CUDART__OPENGL_1ga48bc83e2aeff82904589243a11b5e09" id="group__CUDART__OPENGL_1ga48bc83e2aeff82904589243a11b5e09" shape="rect">
                              <!-- --></a><span><a href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gf599e5b8b829ce7db0f5216928f6ecb6" title="" shape="rect">cudaError_t</a> cudaWGLGetDevice (  int*<span>&nbsp;</span><span class="keyword keyword apiItemName">device</span>, HGPUNV<span>&nbsp;</span><span class="keyword keyword apiItemName">hGpu</span> ) </span></dt>
                        <dd class="description">
                           <div class="section">Gets the CUDA device associated with hGpu. </div>
                           <div class="section">
                              <h6 class="parameter_header">
                                 Parameters
                                 
                              </h6>
                              <dl class="table-display-params">
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">device</span></tt></dt>
                                 <dd>- Returns the device associated with hGpu, or -1 if hGpu is not a compute device. </dd>
                                 <dt><tt class="code"><span class="keyword keyword apiItemName">hGpu</span></tt></dt>
                                 <dd>- Handle to a GPU, as queried via WGL_NV_gpu_affinity</dd>
                              </dl>
                           </div>
                           <div class="section">
                              <h6 class="return_header">Returns</h6>
                              <p class="return"><a class="xref" href="group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591" shape="rect">cudaSuccess</a></p>
                           </div>
                           <div class="section">
                              <h6 class="description_header">Description</h6>
                              <p>Returns the CUDA device associated with a hGpu, if applicable.</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">WGL_NV_gpu_affinity </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>