Sophie

Sophie

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

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: cudaBindTexture2D</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__HIGHLEVEL.html">C++ API Routines</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__HIGHLEVEL_gfb5cfff64c5e0517a678135a29f70a1f.html#gfb5cfff64c5e0517a678135a29f70a1f">cudaBindSurfaceToArray</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_gbf670802ae6a57b3a7410a8543bfda4c.html#gbf670802ae6a57b3a7410a8543bfda4c">cudaBindSurfaceToArray</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_ge519938394a575b306290e05ec12102b.html#ge519938394a575b306290e05ec12102b">cudaBindTexture</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g2aeb95eab6b9d90bb00b26406a27c515.html#g2aeb95eab6b9d90bb00b26406a27c515">cudaBindTexture</a></td></tr>
          <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__HIGHLEVEL_g67660ae3e9a1ff520575394f78087bea.html#g67660ae3e9a1ff520575394f78087bea">cudaBindTexture2D</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g5ae4e8e2d6a28ed3e78caa9a7e853b76.html#g5ae4e8e2d6a28ed3e78caa9a7e853b76">cudaBindTexture2D</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_gbd400c5d860e2a9d4cee3be528a98fc9.html#gbd400c5d860e2a9d4cee3be528a98fc9">cudaBindTextureToArray</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_ge2a164ef1965be448625b810ac389953.html#ge2a164ef1965be448625b810ac389953">cudaBindTextureToArray</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_ga1a74e4296134312d6f117a936bcf2c7.html#ga1a74e4296134312d6f117a936bcf2c7">cudaCreateChannelDesc</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_gb9774a7552ee76b564c8c650b083a86c.html#gb9774a7552ee76b564c8c650b083a86c">cudaEventCreate</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g0b85e087210b47056cb6fc03a0e264e8.html#g0b85e087210b47056cb6fc03a0e264e8">cudaFuncGetAttributes</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_ge0969184de8a5c2d809aa8d7d2425484.html#ge0969184de8a5c2d809aa8d7d2425484">cudaFuncSetCacheConfig</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g5ca79fbb1f49f7fb8e45d768418c10f7.html#g5ca79fbb1f49f7fb8e45d768418c10f7">cudaGetSymbolAddress</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g9b568e473b813e84aba99c44e6d57a90.html#g9b568e473b813e84aba99c44e6d57a90">cudaGetSymbolSize</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g0beb56df79e50d3e4b1b86adeb2c10bc.html#g0beb56df79e50d3e4b1b86adeb2c10bc">cudaGetTextureAlignmentOffset</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g272647001e68a2993cdf6a05bb89c182.html#g272647001e68a2993cdf6a05bb89c182">cudaLaunch</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_ge439496de696b166ba457dab5dd4f356.html#ge439496de696b166ba457dab5dd4f356">cudaMallocHost</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g0ffbffed226005960c39688493c94c84.html#g0ffbffed226005960c39688493c94c84">cudaSetupArgument</a></td></tr>
          <tr><td class="navtab"><a class="qindex" href="group__CUDART__HIGHLEVEL_g1c9273b8f04336f58ec73842f08fb25b.html#g1c9273b8f04336f58ec73842f08fb25b">cudaUnbindTexture</a></td></tr>
        </table>
      </div>
   </td>
   <td valign="top">
<a class="anchor" name="g67660ae3e9a1ff520575394f78087bea"></a><!-- doxytag: member="cuda_runtime.h::cudaBindTexture2D" ref="g67660ae3e9a1ff520575394f78087bea" args="(size_t *offset, const struct texture&lt; T, dim, readMode &gt; &amp;tex, const void *devPtr, size_t width, size_t height, size_t pitch)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T , int dim, enum cudaTextureReadMode readMode&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__CUDART__TYPES_gf599e5b8b829ce7db0f5216928f6ecb6.html#gf599e5b8b829ce7db0f5216928f6ecb6">cudaError_t</a> cudaBindTexture2D           </td>
          <td>(</td>
          <td class="paramtype">size_t *&nbsp;</td>
          <td class="paramname"> <em>offset</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct texture&lt; T, dim, readMode &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>tex</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>devPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>width</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>height</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>pitch</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Binds the 2D memory area pointed to by <code>devPtr</code> to the texture reference <code>tex</code>. The size of the area is constrained by <code>width</code> in texel units, <code>height</code> in texel units, and <code>pitch</code> in byte units. The channel descriptor is inherited from the texture reference type. Any memory previously bound to <code>tex</code> is unbound.<p>
Since the hardware enforces an alignment requirement on texture base addresses, <a class="el" href="group__CUDART__HIGHLEVEL_g67660ae3e9a1ff520575394f78087bea.html#g67660ae3e9a1ff520575394f78087bea">cudaBindTexture2D()</a> returns in <code>*offset</code> a byte offset that must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel size and passed to kernels that read from the texture so they can be applied to the tex2D() function. If the device memory pointer was returned from <a class="el" href="group__CUDART__MEMORY_gc63ffd93e344b939d6399199d8b12fef.html#gc63ffd93e344b939d6399199d8b12fef" title="Allocate memory on the device.">cudaMalloc()</a>, the offset is guaranteed to be 0 and NULL may be passed as the <code>offset</code> parameter.<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>offset</em>&nbsp;</td><td>- Offset in bytes </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>tex</em>&nbsp;</td><td>- Texture reference to bind </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>devPtr</em>&nbsp;</td><td>- 2D memory area on device </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>width</em>&nbsp;</td><td>- Width in texel units </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>height</em>&nbsp;</td><td>- Height in texel units </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>pitch</em>&nbsp;</td><td>- Pitch in bytes</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#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00385fa2f00ab72ab5cf649a0a32351a20bf">cudaErrorInvalidDevicePointer</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038e4312b7621ebad05ce494249474a7e11">cudaErrorInvalidTexture</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__HIGHLEVEL_ga1a74e4296134312d6f117a936bcf2c7.html#ga1a74e4296134312d6f117a936bcf2c7">cudaCreateChannelDesc (C++ API)</a>, <a class="el" href="group__CUDART__TEXTURE_g85b045ff1ea082ed580e2a578a689df3.html#g85b045ff1ea082ed580e2a578a689df3" title="Get the channel descriptor of an array.">cudaGetChannelDesc</a>, <a class="el" href="group__CUDART__TEXTURE__DEPRECATED_gc86c8aca553c7d6dcd8c57e5b93882a8.html#gc86c8aca553c7d6dcd8c57e5b93882a8" title="Get the texture reference associated with a symbol.">cudaGetTextureReference</a>, <a class="el" href="group__CUDART__HIGHLEVEL_ge519938394a575b306290e05ec12102b.html#ge519938394a575b306290e05ec12102b">cudaBindTexture (C++ API)</a>, <a class="el" href="group__CUDART__HIGHLEVEL_g2aeb95eab6b9d90bb00b26406a27c515.html#g2aeb95eab6b9d90bb00b26406a27c515">cudaBindTexture (C++ API, inherited channel descriptor)</a>, <a class="el" href="group__CUDART__TEXTURE_gdc3ad1bb212e76043659f7e57a5ffba6.html#gdc3ad1bb212e76043659f7e57a5ffba6">cudaBindTexture2D (C API)</a>, <a class="el" href="group__CUDART__HIGHLEVEL_g5ae4e8e2d6a28ed3e78caa9a7e853b76.html#g5ae4e8e2d6a28ed3e78caa9a7e853b76">cudaBindTexture2D (C++ API)</a>, <a class="el" href="group__CUDART__HIGHLEVEL_gbd400c5d860e2a9d4cee3be528a98fc9.html#gbd400c5d860e2a9d4cee3be528a98fc9">cudaBindTextureToArray (C++ API)</a>, <a class="el" href="group__CUDART__HIGHLEVEL_ge2a164ef1965be448625b810ac389953.html#ge2a164ef1965be448625b810ac389953">cudaBindTextureToArray (C++ API, inherited channel descriptor)</a>, <a class="el" href="group__CUDART__HIGHLEVEL_g1c9273b8f04336f58ec73842f08fb25b.html#g1c9273b8f04336f58ec73842f08fb25b">cudaUnbindTexture (C++ API)</a>, <a class="el" href="group__CUDART__HIGHLEVEL_g0beb56df79e50d3e4b1b86adeb2c10bc.html#g0beb56df79e50d3e4b1b86adeb2c10bc">cudaGetTextureAlignmentOffset (C++ API)</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>