| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 |
<meta http-equiv="X-UA-Compatible" content="IE=11"/> |
| 6 |
<meta name="generator" content="Doxygen 1.15.0"/> |
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 |
<title>Hardware Locality (hwloc): Interoperability with the CUDA Driver API</title> |
| 9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 |
<script type="text/javascript" src="jquery.js"></script> |
| 11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 12 |
<script type="text/javascript" src="clipboard.js"></script> |
| 13 |
<link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 14 |
</head> |
| 15 |
<body> |
| 16 |
<div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 17 |
<div id="titlearea"> |
| 18 |
<table cellspacing="0" cellpadding="0"> |
| 19 |
<tbody> |
| 20 |
<tr id="projectrow"> |
| 21 |
<td id="projectalign"> |
| 22 |
<div id="projectname">Hardware Locality (hwloc)<span id="projectnumber"> 2.14.0</span> |
| 23 |
</div> |
| 24 |
</td> |
| 25 |
</tr> |
| 26 |
</tbody> |
| 27 |
</table> |
| 28 |
</div> |
| 29 |
<!-- end header part --> |
| 30 |
<!-- Generated by Doxygen 1.15.0 --> |
| 31 |
<script type="text/javascript"> |
| 32 |
$(function() { codefold.init(); }); |
| 33 |
</script> |
| 34 |
<script type="text/javascript" src="menudata.js"></script> |
| 35 |
<script type="text/javascript" src="menu.js"></script> |
| 36 |
<script type="text/javascript"> |
| 37 |
$(function() { |
| 38 |
initMenu('',false,false,'search.php','Search',false); |
| 39 |
}); |
| 40 |
</script> |
| 41 |
<div id="main-nav"></div> |
| 42 |
</div><!-- top --> |
| 43 |
<div id="doc-content"> |
| 44 |
<div class="header"> |
| 45 |
<div class="summary"> |
| 46 |
<a href="#func-members">Functions</a> </div> |
| 47 |
<div class="headertitle"><div class="title">Interoperability with the CUDA Driver API </div></div> |
| 48 |
</div><!--header--> |
| 49 |
<div class="contents"> |
| 50 |
<table class="memberdecls"> |
| 51 |
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a> |
| 52 |
Functions</h2></td></tr> |
| 53 |
<tr class="memitem:gaccaaa877ac53df56ec34de24467c1d5a" id="r_gaccaaa877ac53df56ec34de24467c1d5a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaccaaa877ac53df56ec34de24467c1d5a">hwloc_cuda_get_device_pci_ids</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, CUdevice cudevice, int *domain, int *bus, int *dev)</td></tr> |
| 54 |
<tr class="memitem:ga02c38c04fa6de56519aca04f46700145" id="r_ga02c38c04fa6de56519aca04f46700145"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga02c38c04fa6de56519aca04f46700145">hwloc_cuda_get_device_cpuset</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, CUdevice cudevice, <a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set)</td></tr> |
| 55 |
<tr class="memitem:ga6ad9d84fd2ce3d6e3979b5e1ac1079a7" id="r_ga6ad9d84fd2ce3d6e3979b5e1ac1079a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga6ad9d84fd2ce3d6e3979b5e1ac1079a7">hwloc_cuda_get_device_pcidev</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, CUdevice cudevice)</td></tr> |
| 56 |
<tr class="memitem:ga3bd29e11e8d2c3122260baaa6311ff97" id="r_ga3bd29e11e8d2c3122260baaa6311ff97"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3bd29e11e8d2c3122260baaa6311ff97">hwloc_cuda_get_device_osdev</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, CUdevice cudevice)</td></tr> |
| 57 |
<tr class="memitem:ga94bd22defc09e07bd122ade707fef620" id="r_ga94bd22defc09e07bd122ade707fef620"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga94bd22defc09e07bd122ade707fef620">hwloc_cuda_get_device_osdev_by_index</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, unsigned idx)</td></tr> |
| 58 |
</table> |
| 59 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 60 |
<p>This interface offers ways to retrieve topology information about CUDA devices when using the CUDA Driver API. </p> |
| 61 |
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2> |
| 62 |
<a id="ga02c38c04fa6de56519aca04f46700145" name="ga02c38c04fa6de56519aca04f46700145"></a> |
| 63 |
<h2 class="memtitle"><span class="permalink"><a href="#ga02c38c04fa6de56519aca04f46700145">◆ </a></span>hwloc_cuda_get_device_cpuset()</h2> |
| 64 |
|
| 65 |
<div class="memitem"> |
| 66 |
<div class="memproto"> |
| 67 |
<table class="mlabels"> |
| 68 |
<tr> |
| 69 |
<td class="mlabels-left"> |
| 70 |
<table class="memname"> |
| 71 |
<tr> |
| 72 |
<td class="memname">int hwloc_cuda_get_device_cpuset </td> |
| 73 |
<td>(</td> |
| 74 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 75 |
</tr> |
| 76 |
<tr> |
| 77 |
<td class="paramkey"></td> |
| 78 |
<td></td> |
| 79 |
<td class="paramtype">CUdevice</td> <td class="paramname"><span class="paramname"><em>cudevice</em></span>, </td> |
| 80 |
</tr> |
| 81 |
<tr> |
| 82 |
<td class="paramkey"></td> |
| 83 |
<td></td> |
| 84 |
<td class="paramtype"><a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a></td> <td class="paramname"><span class="paramname"><em>set</em></span> )</td> |
| 85 |
</tr> |
| 86 |
</table> |
| 87 |
</td> |
| 88 |
<td class="mlabels-right"> |
| 89 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 90 |
</tr> |
| 91 |
</table> |
| 92 |
</div><div class="memdoc"> |
| 93 |
|
| 94 |
<p>Get the CPU set of processors that are physically close to device <code class="param">cudevice</code>. </p> |
| 95 |
<p>Store in <code class="param">set</code> the CPU-set describing the locality of the CUDA device <code class="param">cudevice</code>.</p> |
| 96 |
<p>Topology <code class="param">topology</code> and device <code class="param">cudevice</code> must match the local machine. I/O devices detection and the CUDA component are not needed in the topology.</p> |
| 97 |
<p>The function only returns the locality of the device. If more information about the device is needed, OS objects should be used instead, see <a class="el" href="#ga3bd29e11e8d2c3122260baaa6311ff97" title="Get the hwloc OS device object corresponding to CUDA device cudevice.">hwloc_cuda_get_device_osdev()</a> and <a class="el" href="#ga94bd22defc09e07bd122ade707fef620" title="Get the hwloc OS device object corresponding to the CUDA device whose index is idx.">hwloc_cuda_get_device_osdev_by_index()</a>.</p> |
| 98 |
<p>This function is currently only implemented in a meaningful way for Linux; other systems will simply get the cpuset of the entire topology.</p> |
| 99 |
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd> |
| 100 |
<dd> |
| 101 |
-1 on error, for instance if device information could not be found. </dd></dl> |
| 102 |
|
| 103 |
</div> |
| 104 |
</div> |
| 105 |
<a id="ga3bd29e11e8d2c3122260baaa6311ff97" name="ga3bd29e11e8d2c3122260baaa6311ff97"></a> |
| 106 |
<h2 class="memtitle"><span class="permalink"><a href="#ga3bd29e11e8d2c3122260baaa6311ff97">◆ </a></span>hwloc_cuda_get_device_osdev()</h2> |
| 107 |
|
| 108 |
<div class="memitem"> |
| 109 |
<div class="memproto"> |
| 110 |
<table class="mlabels"> |
| 111 |
<tr> |
| 112 |
<td class="mlabels-left"> |
| 113 |
<table class="memname"> |
| 114 |
<tr> |
| 115 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_cuda_get_device_osdev </td> |
| 116 |
<td>(</td> |
| 117 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 118 |
</tr> |
| 119 |
<tr> |
| 120 |
<td class="paramkey"></td> |
| 121 |
<td></td> |
| 122 |
<td class="paramtype">CUdevice</td> <td class="paramname"><span class="paramname"><em>cudevice</em></span> )</td> |
| 123 |
</tr> |
| 124 |
</table> |
| 125 |
</td> |
| 126 |
<td class="mlabels-right"> |
| 127 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 128 |
</tr> |
| 129 |
</table> |
| 130 |
</div><div class="memdoc"> |
| 131 |
|
| 132 |
<p>Get the hwloc OS device object corresponding to CUDA device <code class="param">cudevice</code>. </p> |
| 133 |
<dl class="section return"><dt>Returns</dt><dd>The hwloc OS device object that describes the given CUDA device <code class="param">cudevice</code>. </dd> |
| 134 |
<dd> |
| 135 |
<code>NULL</code> if none could be found.</dd></dl> |
| 136 |
<p>Topology <code class="param">topology</code> and device <code class="param">cudevice</code> must match the local machine. I/O devices detection and the CUDA component must be enabled in the topology. If not, the locality of the object may still be found using <a class="el" href="#ga02c38c04fa6de56519aca04f46700145" title="Get the CPU set of processors that are physically close to device cudevice.">hwloc_cuda_get_device_cpuset()</a>.</p> |
| 137 |
<dl class="section note"><dt>Note</dt><dd>This function cannot work if PCI devices are filtered out.</dd> |
| 138 |
<dd> |
| 139 |
The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out). </dd></dl> |
| 140 |
|
| 141 |
</div> |
| 142 |
</div> |
| 143 |
<a id="ga94bd22defc09e07bd122ade707fef620" name="ga94bd22defc09e07bd122ade707fef620"></a> |
| 144 |
<h2 class="memtitle"><span class="permalink"><a href="#ga94bd22defc09e07bd122ade707fef620">◆ </a></span>hwloc_cuda_get_device_osdev_by_index()</h2> |
| 145 |
|
| 146 |
<div class="memitem"> |
| 147 |
<div class="memproto"> |
| 148 |
<table class="mlabels"> |
| 149 |
<tr> |
| 150 |
<td class="mlabels-left"> |
| 151 |
<table class="memname"> |
| 152 |
<tr> |
| 153 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_cuda_get_device_osdev_by_index </td> |
| 154 |
<td>(</td> |
| 155 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 156 |
</tr> |
| 157 |
<tr> |
| 158 |
<td class="paramkey"></td> |
| 159 |
<td></td> |
| 160 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>idx</em></span> )</td> |
| 161 |
</tr> |
| 162 |
</table> |
| 163 |
</td> |
| 164 |
<td class="mlabels-right"> |
| 165 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 166 |
</tr> |
| 167 |
</table> |
| 168 |
</div><div class="memdoc"> |
| 169 |
|
| 170 |
<p>Get the hwloc OS device object corresponding to the CUDA device whose index is <code class="param">idx</code>. </p> |
| 171 |
<dl class="section return"><dt>Returns</dt><dd>The hwloc OS device object describing the CUDA device whose index is <code class="param">idx</code>. </dd> |
| 172 |
<dd> |
| 173 |
<code>NULL</code> if none could be found.</dd></dl> |
| 174 |
<p>The topology <code class="param">topology</code> does not necessarily have to match the current machine. For instance the topology may be an XML import of a remote host. I/O devices detection and the CUDA component must be enabled in the topology.</p> |
| 175 |
<dl class="section note"><dt>Note</dt><dd>The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out).</dd> |
| 176 |
<dd> |
| 177 |
This function is identical to <a class="el" href="a00205.html#ga959b08bcbaa77d39a79cfbb5b4883349" title="Get the hwloc OS device object corresponding to the CUDA device whose index is idx.">hwloc_cudart_get_device_osdev_by_index()</a>. </dd></dl> |
| 178 |
|
| 179 |
</div> |
| 180 |
</div> |
| 181 |
<a id="gaccaaa877ac53df56ec34de24467c1d5a" name="gaccaaa877ac53df56ec34de24467c1d5a"></a> |
| 182 |
<h2 class="memtitle"><span class="permalink"><a href="#gaccaaa877ac53df56ec34de24467c1d5a">◆ </a></span>hwloc_cuda_get_device_pci_ids()</h2> |
| 183 |
|
| 184 |
<div class="memitem"> |
| 185 |
<div class="memproto"> |
| 186 |
<table class="mlabels"> |
| 187 |
<tr> |
| 188 |
<td class="mlabels-left"> |
| 189 |
<table class="memname"> |
| 190 |
<tr> |
| 191 |
<td class="memname">int hwloc_cuda_get_device_pci_ids </td> |
| 192 |
<td>(</td> |
| 193 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 194 |
</tr> |
| 195 |
<tr> |
| 196 |
<td class="paramkey"></td> |
| 197 |
<td></td> |
| 198 |
<td class="paramtype">CUdevice</td> <td class="paramname"><span class="paramname"><em>cudevice</em></span>, </td> |
| 199 |
</tr> |
| 200 |
<tr> |
| 201 |
<td class="paramkey"></td> |
| 202 |
<td></td> |
| 203 |
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>domain</em></span>, </td> |
| 204 |
</tr> |
| 205 |
<tr> |
| 206 |
<td class="paramkey"></td> |
| 207 |
<td></td> |
| 208 |
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>bus</em></span>, </td> |
| 209 |
</tr> |
| 210 |
<tr> |
| 211 |
<td class="paramkey"></td> |
| 212 |
<td></td> |
| 213 |
<td class="paramtype">int *</td> <td class="paramname"><span class="paramname"><em>dev</em></span> )</td> |
| 214 |
</tr> |
| 215 |
</table> |
| 216 |
</td> |
| 217 |
<td class="mlabels-right"> |
| 218 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 219 |
</tr> |
| 220 |
</table> |
| 221 |
</div><div class="memdoc"> |
| 222 |
|
| 223 |
<p>Return the domain, bus and device IDs of the CUDA device <code class="param">cudevice</code>. </p> |
| 224 |
<p>Device <code class="param">cudevice</code> must match the local machine.</p> |
| 225 |
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd> |
| 226 |
<dd> |
| 227 |
-1 on error, for instance if device information could not be found. </dd></dl> |
| 228 |
|
| 229 |
</div> |
| 230 |
</div> |
| 231 |
<a id="ga6ad9d84fd2ce3d6e3979b5e1ac1079a7" name="ga6ad9d84fd2ce3d6e3979b5e1ac1079a7"></a> |
| 232 |
<h2 class="memtitle"><span class="permalink"><a href="#ga6ad9d84fd2ce3d6e3979b5e1ac1079a7">◆ </a></span>hwloc_cuda_get_device_pcidev()</h2> |
| 233 |
|
| 234 |
<div class="memitem"> |
| 235 |
<div class="memproto"> |
| 236 |
<table class="mlabels"> |
| 237 |
<tr> |
| 238 |
<td class="mlabels-left"> |
| 239 |
<table class="memname"> |
| 240 |
<tr> |
| 241 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_cuda_get_device_pcidev </td> |
| 242 |
<td>(</td> |
| 243 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 244 |
</tr> |
| 245 |
<tr> |
| 246 |
<td class="paramkey"></td> |
| 247 |
<td></td> |
| 248 |
<td class="paramtype">CUdevice</td> <td class="paramname"><span class="paramname"><em>cudevice</em></span> )</td> |
| 249 |
</tr> |
| 250 |
</table> |
| 251 |
</td> |
| 252 |
<td class="mlabels-right"> |
| 253 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 254 |
</tr> |
| 255 |
</table> |
| 256 |
</div><div class="memdoc"> |
| 257 |
|
| 258 |
<p>Get the hwloc PCI device object corresponding to the CUDA device <code class="param">cudevice</code>. </p> |
| 259 |
<dl class="section return"><dt>Returns</dt><dd>The hwloc PCI device object describing the CUDA device <code class="param">cudevice</code>. </dd> |
| 260 |
<dd> |
| 261 |
<code>NULL</code> if none could be found.</dd></dl> |
| 262 |
<p>Topology <code class="param">topology</code> and device <code class="param">cudevice</code> must match the local machine. I/O devices detection must be enabled in topology <code class="param">topology</code>. The CUDA component is not needed in the topology. </p> |
| 263 |
|
| 264 |
</div> |
| 265 |
</div> |
| 266 |
</div><!-- contents --> |
| 267 |
<!-- start footer part --> |
| 268 |
<hr class="footer"/><address class="footer"><small> |
| 269 |
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 |
| 270 |
</small></address> |
| 271 |
</div><!-- doc-content --> |
| 272 |
</body> |
| 273 |
</html> |