Sophie

Sophie

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

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: cudaPointerGetAttributes</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__UNIFIED.html">Unified Addressing</a>
  </div>
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
   <td valign="top">
      <div class="navtab">
        <table>
          <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__UNIFIED_gab5cad40942fd554556035741d3fe5a2.html#gab5cad40942fd554556035741d3fe5a2">cudaPointerGetAttributes</a></td></tr>
        </table>
      </div>
   </td>
   <td valign="top">
<a class="anchor" name="gab5cad40942fd554556035741d3fe5a2"></a><!-- doxytag: member="cuda_runtime_api.h::cudaPointerGetAttributes" ref="gab5cad40942fd554556035741d3fe5a2" args="(struct cudaPointerAttributes *attributes, const void *ptr)" -->
<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> cudaPointerGetAttributes           </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structcudaPointerAttributes.html">cudaPointerAttributes</a> *&nbsp;</td>
          <td class="paramname"> <em>attributes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>ptr</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns in <code>*attributes</code> the attributes of the pointer <code>ptr</code>.<p>
The <a class="el" href="structcudaPointerAttributes.html">cudaPointerAttributes</a> structure is defined as: <div class="fragment"><pre class="fragment">    <span class="keyword">struct </span><a class="code" href="structcudaPointerAttributes.html">cudaPointerAttributes</a> {
        <span class="keyword">enum</span> <a class="code" href="group__CUDART__TYPES_g13de56a8fe75569530ecc3a3106e9b6d.html#g13de56a8fe75569530ecc3a3106e9b6d">cudaMemoryType</a> <a class="code" href="structcudaPointerAttributes_b73616e2fdbf607eb6dfc8c87fb9b830.html#b73616e2fdbf607eb6dfc8c87fb9b830">memoryType</a>;
        <span class="keywordtype">int</span> <a class="code" href="structcudaPointerAttributes_20015540684b0c85e0debf64923bedec.html#20015540684b0c85e0debf64923bedec">device</a>;
        <span class="keywordtype">void</span> *<a class="code" href="structcudaPointerAttributes_9edc9782e1ee337072994780fd3b675f.html#9edc9782e1ee337072994780fd3b675f">devicePointer</a>;
        <span class="keywordtype">void</span> *<a class="code" href="structcudaPointerAttributes_19cbae18cd685096287e41cce1c9a087.html#19cbae18cd685096287e41cce1c9a087">hostPointer</a>;
    }
</pre></div> In this structure, the individual fields mean<p>
<ul>
<li><a class="el" href="structcudaPointerAttributes_b73616e2fdbf607eb6dfc8c87fb9b830.html#b73616e2fdbf607eb6dfc8c87fb9b830">memoryType</a> identifies the physical location of the memory associated with pointer <code>ptr</code>. It can be <a class="el" href="group__CUDART__TYPES_g13de56a8fe75569530ecc3a3106e9b6d.html#gg13de56a8fe75569530ecc3a3106e9b6d9aa7478ab438d2dfb710c9100194a5be">cudaMemoryTypeHost</a> for host memory or <a class="el" href="group__CUDART__TYPES_g13de56a8fe75569530ecc3a3106e9b6d.html#gg13de56a8fe75569530ecc3a3106e9b6d30c8466dd99563e4b1a43dd27bf7c743">cudaMemoryTypeDevice</a> for device memory.</li></ul>
<p>
<ul>
<li><a class="el" href="structcudaPointerAttributes_20015540684b0c85e0debf64923bedec.html#20015540684b0c85e0debf64923bedec">device</a> is the device against which <code>ptr</code> was allocated. If <code>ptr</code> has memory type <a class="el" href="group__CUDART__TYPES_g13de56a8fe75569530ecc3a3106e9b6d.html#gg13de56a8fe75569530ecc3a3106e9b6d30c8466dd99563e4b1a43dd27bf7c743">cudaMemoryTypeDevice</a> then this identifies the device on which the memory referred to by <code>ptr</code> physically resides. If <code>ptr</code> has memory type <a class="el" href="group__CUDART__TYPES_g13de56a8fe75569530ecc3a3106e9b6d.html#gg13de56a8fe75569530ecc3a3106e9b6d9aa7478ab438d2dfb710c9100194a5be">cudaMemoryTypeHost</a> then this identifies the device which was current when the allocation was made (and if that device is deinitialized then this allocation will vanish with that device's state).</li></ul>
<p>
<ul>
<li><a class="el" href="structcudaPointerAttributes_9edc9782e1ee337072994780fd3b675f.html#9edc9782e1ee337072994780fd3b675f">devicePointer</a> is the device pointer alias through which the memory referred to by <code>ptr</code> may be accessed on the current device. If the memory referred to by <code>ptr</code> cannot be accessed directly by the current device then this is NULL.</li></ul>
<p>
<ul>
<li><a class="el" href="structcudaPointerAttributes_19cbae18cd685096287e41cce1c9a087.html#19cbae18cd685096287e41cce1c9a087">hostPointer</a> is the host pointer alias through which the memory referred to by <code>ptr</code> may be accessed on the host. If the memory referred to by <code>ptr</code> cannot be accessed directly by the host then this is NULL.</li></ul>
<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>attributes</em>&nbsp;</td><td>- Attributes for the specified pointer </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>- Pointer to get attributes for</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#gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a">cudaErrorInvalidDevice</a></dd></dl>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__CUDART__DEVICE_g665468e8cb33be42434f11bee2684ec9.html#g665468e8cb33be42434f11bee2684ec9" title="Returns the number of compute-capable devices.">cudaGetDeviceCount</a>, <a class="el" href="group__CUDART__DEVICE_g1795645d53ca669d84d2aff6f3706917.html#g1795645d53ca669d84d2aff6f3706917" title="Returns which device is currently being used.">cudaGetDevice</a>, <a class="el" href="group__CUDART__DEVICE_g418c299b069c4803bfb7cab4943da383.html#g418c299b069c4803bfb7cab4943da383" title="Set device to be used for GPU executions.">cudaSetDevice</a>, <a class="el" href="group__CUDART__DEVICE_g028e5b0474379eaf5f5d54657d48600b.html#g028e5b0474379eaf5f5d54657d48600b" title="Select compute-device which best matches criteria.">cudaChooseDevice</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>