Sophie

Sophie

distrib > Mageia > 2 > i586 > media > nonfree-release > by-pkgid > f86555c654b1f4a4c7ccf47789979868 > files > 742

nvidia-cuda-toolkit-devel-4.2.9-2.mga2.nonfree.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>NVIDIA CUDA Library: cudaD3D9SetDirect3DDevice</title>
<link href="customdoxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
  <div class="navpath"><a class="el" href="group__CUDART__D3D9.html">Direct3D 9 Interoperability</a>
  </div>
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
   <td valign="top">
      <div class="navtab">
        <table>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9_g93e3d8aabc986f1799a2754135e31379.html#g93e3d8aabc986f1799a2754135e31379">cudaD3D9DeviceList</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9_gce3447041e9b21679501dfd5d54d0475.html#gce3447041e9b21679501dfd5d54d0475">cudaD3D9GetDevice</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9_g3e0de372020bba09fe032a956736dd27.html#g3e0de372020bba09fe032a956736dd27">cudaD3D9GetDevices</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9_g18e9449a409a1d3d606a52cbd73ad235.html#g18e9449a409a1d3d606a52cbd73ad235">cudaD3D9GetDirect3DDevice</a></td></tr>
          <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__D3D9_g3b7a9c5a5f249fa1f8fb5743304474b5.html#g3b7a9c5a5f249fa1f8fb5743304474b5">cudaD3D9SetDirect3DDevice</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__D3D9_gbe1082b566be4ab414bf69047449ad93.html#gbe1082b566be4ab414bf69047449ad93">cudaGraphicsD3D9RegisterResource</a></td></tr>
        </table>
      </div>
   </td>
   <td valign="top">
<a class="anchor" name="g3b7a9c5a5f249fa1f8fb5743304474b5"></a><!-- doxytag: member="cuda_d3d9_interop.h::cudaD3D9SetDirect3DDevice" ref="g3b7a9c5a5f249fa1f8fb5743304474b5" args="(IDirect3DDevice9 *pD3D9Device, int device=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__CUDART__TYPES_gf599e5b8b829ce7db0f5216928f6ecb6.html#gf599e5b8b829ce7db0f5216928f6ecb6">cudaError_t</a> cudaD3D9SetDirect3DDevice           </td>
          <td>(</td>
          <td class="paramtype">IDirect3DDevice9 *&nbsp;</td>
          <td class="paramname"> <em>pD3D9Device</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>device</em> = <code>-1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Records <code>pD3D9Device</code> as the Direct3D 9 device to use for Direct3D 9 interoperability with the CUDA device <code>device</code> and sets <code>device</code> as the current device for the calling host thread.<p>
If <code>device</code> has already been initialized then this call will fail with the error <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038a906ddf08d574274bf7334adb1497550">cudaErrorSetOnActiveProcess</a>. In this case it is necessary to reset <code>device</code> using <a class="el" href="group__CUDART__DEVICE_gdcc2c6f914eb9461565b12648faa5e28.html#gdcc2c6f914eb9461565b12648faa5e28" title="Destroy all allocations and reset all state on the current device in the current...">cudaDeviceReset()</a> before Direct3D 9 interoperability on <code>device</code> may be enabled.<p>
Successfully initializing CUDA interoperability with <code>pD3D9Device</code> will increase the internal reference count on <code>pD3D9Device</code>. This reference count will be decremented when <code>device</code> is reset using <a class="el" href="group__CUDART__DEVICE_gdcc2c6f914eb9461565b12648faa5e28.html#gdcc2c6f914eb9461565b12648faa5e28" title="Destroy all allocations and reset all state on the current device in the current...">cudaDeviceReset()</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>pD3D9Device</em>&nbsp;</td><td>- Direct3D device to use for this thread </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>device</em>&nbsp;</td><td>- The CUDA device to use. This device must be among the devices returned when querying <a class="el" href="group__CUDART__D3D9_g93e3d8aabc986f1799a2754135e31379.html#gg93e3d8aabc986f1799a2754135e31379d60701634fd33febe258c9192ce49a89">cudaD3D9DeviceListAll</a> from <a class="el" href="group__CUDART__D3D9_g3e0de372020bba09fe032a956736dd27.html#g3e0de372020bba09fe032a956736dd27" title="Gets the CUDA devices corresponding to a Direct3D 9 device.">cudaD3D9GetDevices</a>, may be set to -1 to automatically select an appropriate CUDA device.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591">cudaSuccess</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c">cudaErrorInitializationError</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038a906ddf08d574274bf7334adb1497550">cudaErrorSetOnActiveProcess</a> </dd></dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Note that this function may also return error codes from previous, asynchronous launches.</dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__CUDART__D3D9_gce3447041e9b21679501dfd5d54d0475.html#gce3447041e9b21679501dfd5d54d0475" title="Gets the device number for an adapter.">cudaD3D9GetDevice</a>, <a class="el" href="group__CUDART__D3D9_gbe1082b566be4ab414bf69047449ad93.html#gbe1082b566be4ab414bf69047449ad93" title="Register a Direct3D 9 resource for access by CUDA.">cudaGraphicsD3D9RegisterResource</a>, <a class="el" href="group__CUDART__DEVICE_gdcc2c6f914eb9461565b12648faa5e28.html#gdcc2c6f914eb9461565b12648faa5e28" title="Destroy all allocations and reset all state on the current device in the current...">cudaDeviceReset</a> </dd></dl>

</div>
</div><p>
    </td>
  </tr>
</table>
</div>
<hr size="1"><address style="text-align: right;"><small>
Generated by Doxygen for NVIDIA CUDA Library &nbsp;<a
href="http://www.nvidia.com/cuda"><img src="nvidia_logo.jpg" alt="NVIDIA" align="middle" border="0" height="80"></a></small></address>
</body>
</html>