Sophie

Sophie

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

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: cuPointerGetAttribute</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__CUDA__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__CUDA__UNIFIED_g0c28ed0aff848042bc0533110e45820c.html#g0c28ed0aff848042bc0533110e45820c">cuPointerGetAttribute</a></td></tr>
        </table>
      </div>
   </td>
   <td valign="top">
<a class="anchor" name="g0c28ed0aff848042bc0533110e45820c"></a><!-- doxytag: member="cuda.h::cuPointerGetAttribute" ref="g0c28ed0aff848042bc0533110e45820c" args="(void *data, CUpointer_attribute attribute, CUdeviceptr ptr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__CUDA__TYPES_g09da14df1a751dcbfeccb9cf0073d64c.html#g09da14df1a751dcbfeccb9cf0073d64c">CUresult</a> cuPointerGetAttribute           </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CUDA__TYPES_ga12c0a049a39e783663bd31cd49a2c57.html#ga12c0a049a39e783663bd31cd49a2c57">CUpointer_attribute</a>&nbsp;</td>
          <td class="paramname"> <em>attribute</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__CUDA__TYPES_g5e264ce2ad6a38761e7e04921ef771de.html#g5e264ce2ad6a38761e7e04921ef771de">CUdeviceptr</a>&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>
The supported attributes are:<p>
<ul>
<li><a class="el" href="group__CUDA__TYPES_gb3c95cb65dc7cb3e03e562d129cbb573.html#ggb3c95cb65dc7cb3e03e562d129cbb573f0470fdbd1a5ff72c341f762f49506ab">CU_POINTER_ATTRIBUTE_CONTEXT</a>:</li></ul>
<p>
Returns in <code>*data</code> the <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> in which <code>ptr</code> was allocated or registered. The type of <code>data</code> must be <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> *.<p>
If <code>ptr</code> was not allocated by, mapped by, or registered with a <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> which uses unified virtual addressing then <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa90696c86fcee1f536a1ec7d25867feeb">CUDA_ERROR_INVALID_VALUE</a> is returned.<p>
<ul>
<li><a class="el" href="group__CUDA__TYPES_gb3c95cb65dc7cb3e03e562d129cbb573.html#ggb3c95cb65dc7cb3e03e562d129cbb5730409e16293b60b383f30a9b417b2917c">CU_POINTER_ATTRIBUTE_MEMORY_TYPE</a>:</li></ul>
<p>
Returns in <code>*data</code> the physical memory type of the memory that <code>ptr</code> addresses as a <a class="el" href="group__CUDA__TYPES_g9e45c622a47315753c4725c101148a81.html#g9e45c622a47315753c4725c101148a81">CUmemorytype</a> enumerated value. The type of <code>data</code> must be unsigned int.<p>
If <code>ptr</code> addresses device memory then <code>*data</code> is set to <a class="el" href="group__CUDA__TYPES_g401176319b8c53648d525e8859437790.html#gg401176319b8c53648d525e8859437790ec7e15ba4b111a26adb3487023707299">CU_MEMORYTYPE_DEVICE</a>. The particular <a class="el" href="group__CUDA__TYPES_gcd81b70eb9968392bb5cdf582af8eab4.html#gcd81b70eb9968392bb5cdf582af8eab4">CUdevice</a> on which the memory resides is the <a class="el" href="group__CUDA__TYPES_gcd81b70eb9968392bb5cdf582af8eab4.html#gcd81b70eb9968392bb5cdf582af8eab4">CUdevice</a> of the <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> returned by the <a class="el" href="group__CUDA__TYPES_gb3c95cb65dc7cb3e03e562d129cbb573.html#ggb3c95cb65dc7cb3e03e562d129cbb573f0470fdbd1a5ff72c341f762f49506ab">CU_POINTER_ATTRIBUTE_CONTEXT</a> attribute of <code>ptr</code>.<p>
If <code>ptr</code> addresses host memory then <code>*data</code> is set to <a class="el" href="group__CUDA__TYPES_g401176319b8c53648d525e8859437790.html#gg401176319b8c53648d525e88594377907f98a88f26eec8490bfc180c5a73e101">CU_MEMORYTYPE_HOST</a>.<p>
If <code>ptr</code> was not allocated by, mapped by, or registered with a <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> which uses unified virtual addressing then <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa90696c86fcee1f536a1ec7d25867feeb">CUDA_ERROR_INVALID_VALUE</a> is returned.<p>
If the current <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> does not support unified virtual addressing then <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaa484e9af32c1e9893ff21f0e0191a12d">CUDA_ERROR_INVALID_CONTEXT</a> is returned.<p>
<ul>
<li><a class="el" href="group__CUDA__TYPES_gb3c95cb65dc7cb3e03e562d129cbb573.html#ggb3c95cb65dc7cb3e03e562d129cbb573b5446064bbfa484ea8d13025f1573d5d">CU_POINTER_ATTRIBUTE_DEVICE_POINTER</a>:</li></ul>
<p>
Returns in <code>*data</code> the device pointer value through which <code>ptr</code> may be accessed by kernels running in the current <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a>. The type of <code>data</code> must be CUdeviceptr *.<p>
If there exists no device pointer value through which kernels running in the current <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> may access <code>ptr</code> then <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa90696c86fcee1f536a1ec7d25867feeb">CUDA_ERROR_INVALID_VALUE</a> is returned.<p>
If there is no current <a class="el" href="group__CUDA__TYPES_gf9f5bd81658f866613785b3a0bb7d7d9.html#gf9f5bd81658f866613785b3a0bb7d7d9">CUcontext</a> then <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaa484e9af32c1e9893ff21f0e0191a12d">CUDA_ERROR_INVALID_CONTEXT</a> is returned.<p>
Except in the exceptional disjoint addressing cases discussed below, the value returned in <code>*data</code> will equal the input value <code>ptr</code>.<p>
<ul>
<li><a class="el" href="group__CUDA__TYPES_gb3c95cb65dc7cb3e03e562d129cbb573.html#ggb3c95cb65dc7cb3e03e562d129cbb573ab17d9902b1b631982ae6a3a9a436fdc">CU_POINTER_ATTRIBUTE_HOST_POINTER</a>:</li></ul>
<p>
Returns in <code>*data</code> the host pointer value through which <code>ptr</code> may be accessed by by the host program. The type of <code>data</code> must be void **. If there exists no host pointer value through which the host program may directly access <code>ptr</code> then <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa90696c86fcee1f536a1ec7d25867feeb">CUDA_ERROR_INVALID_VALUE</a> is returned.<p>
Except in the exceptional disjoint addressing cases discussed below, the value returned in <code>*data</code> will equal the input value <code>ptr</code>.<p>
<dl class="user" compact><dt><b></b></dt><dd></dd></dl>
Note that for most allocations in the unified virtual address space the host and device pointer for accessing the allocation will be the same. The exceptions to this are<ul>
<li>user memory registered using <a class="el" href="group__CUDA__MEM_gf0a9fe11544326dabd743b7aa6b54223.html#gf0a9fe11544326dabd743b7aa6b54223" title="Registers an existing host memory range for use by CUDA.">cuMemHostRegister</a></li><li>host memory allocated using <a class="el" href="group__CUDA__MEM_g572ca4011bfcb25034888a14d4e035b9.html#g572ca4011bfcb25034888a14d4e035b9" title="Allocates page-locked host memory.">cuMemHostAlloc</a> with the <a class="el" href="group__CUDA__TYPES_g7361580951deecace15352c97a210038.html#g7361580951deecace15352c97a210038">CU_MEMHOSTALLOC_WRITECOMBINED</a> flag For these types of allocation there will exist separate, disjoint host and device addresses for accessing the allocation. In particular</li><li>The host address will correspond to an invalid unmapped device address (which will result in an exception if accessed from the device)</li><li>The device address will correspond to an invalid unmapped host address (which will result in an exception if accessed from the host). For these types of allocations, querying <a class="el" href="group__CUDA__TYPES_gb3c95cb65dc7cb3e03e562d129cbb573.html#ggb3c95cb65dc7cb3e03e562d129cbb573ab17d9902b1b631982ae6a3a9a436fdc">CU_POINTER_ATTRIBUTE_HOST_POINTER</a> and <a class="el" href="group__CUDA__TYPES_gb3c95cb65dc7cb3e03e562d129cbb573.html#ggb3c95cb65dc7cb3e03e562d129cbb573b5446064bbfa484ea8d13025f1573d5d">CU_POINTER_ATTRIBUTE_DEVICE_POINTER</a> may be used to retrieve the host and device addresses from either address.</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>data</em>&nbsp;</td><td>- Returned pointer attribute value </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>attribute</em>&nbsp;</td><td>- Pointer attribute to query </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ptr</em>&nbsp;</td><td>- Pointer</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaa0eed720f8a87cd1c5fd1c453bc7a03d">CUDA_SUCCESS</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaacf52f132faf29b473cdda6061f0f44a">CUDA_ERROR_DEINITIALIZED</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa8feb999f0af99b4a25ab26b3866f4df8">CUDA_ERROR_NOT_INITIALIZED</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaa484e9af32c1e9893ff21f0e0191a12d">CUDA_ERROR_INVALID_CONTEXT</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa90696c86fcee1f536a1ec7d25867feeb">CUDA_ERROR_INVALID_VALUE</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa6f047e7215788ca96c81af92a04bfb6c">CUDA_ERROR_INVALID_DEVICE</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__CUDA__MEM_gb82d2a09844a58dd9e744dc31e8aa467.html#gb82d2a09844a58dd9e744dc31e8aa467" title="Allocates device memory.">cuMemAlloc</a>, <a class="el" href="group__CUDA__MEM_g89b3f154e17cc89b6eea277dbdf5c93a.html#g89b3f154e17cc89b6eea277dbdf5c93a" title="Frees device memory.">cuMemFree</a>, <a class="el" href="group__CUDA__MEM_gdd8311286d2c2691605362c689bc64e0.html#gdd8311286d2c2691605362c689bc64e0" title="Allocates page-locked host memory.">cuMemAllocHost</a>, <a class="el" href="group__CUDA__MEM_g62e0fdbe181dab6b1c90fa1a51c7b92c.html#g62e0fdbe181dab6b1c90fa1a51c7b92c" title="Frees page-locked host memory.">cuMemFreeHost</a>, <a class="el" href="group__CUDA__MEM_g572ca4011bfcb25034888a14d4e035b9.html#g572ca4011bfcb25034888a14d4e035b9" title="Allocates page-locked host memory.">cuMemHostAlloc</a>, <a class="el" href="group__CUDA__MEM_gf0a9fe11544326dabd743b7aa6b54223.html#gf0a9fe11544326dabd743b7aa6b54223" title="Registers an existing host memory range for use by CUDA.">cuMemHostRegister</a>, <a class="el" href="group__CUDA__MEM_g63f450c8125359be87b7623b1c0b2a14.html#g63f450c8125359be87b7623b1c0b2a14" title="Unregisters a memory range that was registered with cuMemHostRegister().">cuMemHostUnregister</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>