| 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 AMD SMI Management Library</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 AMD SMI Management Library </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:gaad2aed9762f04f179892f4176b21c00c" id="r_gaad2aed9762f04f179892f4176b21c00c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaad2aed9762f04f179892f4176b21c00c">hwloc_amdsmi_get_device_cpuset</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, amdsmi_processor_handle proc, <a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set)</td></tr> |
| 54 |
<tr class="memitem:ga681a60045a44ee4641647cb4ceb72221" id="r_ga681a60045a44ee4641647cb4ceb72221"><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="#ga681a60045a44ee4641647cb4ceb72221">hwloc_amdsmi_get_device_osdev_by_index</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, uint32_t hip_id)</td></tr> |
| 55 |
<tr class="memitem:gaba533e7272f0d963f99625dbee2c0ced" id="r_gaba533e7272f0d963f99625dbee2c0ced"><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="#gaba533e7272f0d963f99625dbee2c0ced">hwloc_amdsmi_get_device_osdev</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, amdsmi_processor_handle proc)</td></tr> |
| 56 |
</table> |
| 57 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 58 |
<p>This interface offers ways to retrieve topology information about devices managed by the AMD SMI Management Library. </p> |
| 59 |
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2> |
| 60 |
<a id="gaad2aed9762f04f179892f4176b21c00c" name="gaad2aed9762f04f179892f4176b21c00c"></a> |
| 61 |
<h2 class="memtitle"><span class="permalink"><a href="#gaad2aed9762f04f179892f4176b21c00c">◆ </a></span>hwloc_amdsmi_get_device_cpuset()</h2> |
| 62 |
|
| 63 |
<div class="memitem"> |
| 64 |
<div class="memproto"> |
| 65 |
<table class="mlabels"> |
| 66 |
<tr> |
| 67 |
<td class="mlabels-left"> |
| 68 |
<table class="memname"> |
| 69 |
<tr> |
| 70 |
<td class="memname">int hwloc_amdsmi_get_device_cpuset </td> |
| 71 |
<td>(</td> |
| 72 |
<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> |
| 73 |
</tr> |
| 74 |
<tr> |
| 75 |
<td class="paramkey"></td> |
| 76 |
<td></td> |
| 77 |
<td class="paramtype">amdsmi_processor_handle</td> <td class="paramname"><span class="paramname"><em>proc</em></span>, </td> |
| 78 |
</tr> |
| 79 |
<tr> |
| 80 |
<td class="paramkey"></td> |
| 81 |
<td></td> |
| 82 |
<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> |
| 83 |
</tr> |
| 84 |
</table> |
| 85 |
</td> |
| 86 |
<td class="mlabels-right"> |
| 87 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 88 |
</tr> |
| 89 |
</table> |
| 90 |
</div><div class="memdoc"> |
| 91 |
|
| 92 |
<p>Get the CPU set of logical processors that are physically close to AMD GPU device whose index is <code class="param">dv_ind</code>. </p> |
| 93 |
<p>Store in <code class="param">set</code> the CPU-set describing the locality of the AMD GPU device whose processor handle is <code class="param">proc</code>.</p> |
| 94 |
<p>Topology <code class="param">topology</code> and device <code class="param">dv_ind</code> must match the local machine. I/O devices detection and the ROCm SMI component are not needed in the topology.</p> |
| 95 |
<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="#gaba533e7272f0d963f99625dbee2c0ced" title="Get the hwloc OS device object corresponding to AMD GPU device, whose processor handle is proc.">hwloc_amdsmi_get_device_osdev()</a> and <a class="el" href="#ga681a60045a44ee4641647cb4ceb72221" title="Get the hwloc OS device object corresponding to the AMD GPU device whose HIP index is hip_id.">hwloc_amdsmi_get_device_osdev_by_index()</a>.</p> |
| 96 |
<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> |
| 97 |
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd> |
| 98 |
<dd> |
| 99 |
-1 on error, for instance if device information could not be found. </dd></dl> |
| 100 |
|
| 101 |
</div> |
| 102 |
</div> |
| 103 |
<a id="gaba533e7272f0d963f99625dbee2c0ced" name="gaba533e7272f0d963f99625dbee2c0ced"></a> |
| 104 |
<h2 class="memtitle"><span class="permalink"><a href="#gaba533e7272f0d963f99625dbee2c0ced">◆ </a></span>hwloc_amdsmi_get_device_osdev()</h2> |
| 105 |
|
| 106 |
<div class="memitem"> |
| 107 |
<div class="memproto"> |
| 108 |
<table class="mlabels"> |
| 109 |
<tr> |
| 110 |
<td class="mlabels-left"> |
| 111 |
<table class="memname"> |
| 112 |
<tr> |
| 113 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_amdsmi_get_device_osdev </td> |
| 114 |
<td>(</td> |
| 115 |
<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> |
| 116 |
</tr> |
| 117 |
<tr> |
| 118 |
<td class="paramkey"></td> |
| 119 |
<td></td> |
| 120 |
<td class="paramtype">amdsmi_processor_handle</td> <td class="paramname"><span class="paramname"><em>proc</em></span> )</td> |
| 121 |
</tr> |
| 122 |
</table> |
| 123 |
</td> |
| 124 |
<td class="mlabels-right"> |
| 125 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 126 |
</tr> |
| 127 |
</table> |
| 128 |
</div><div class="memdoc"> |
| 129 |
|
| 130 |
<p>Get the hwloc OS device object corresponding to AMD GPU device, whose processor handle is <code class="param">proc</code>. </p> |
| 131 |
<dl class="section return"><dt>Returns</dt><dd>The hwloc OS device object that describes the given AMD GPU, whose processor handle is <code class="param">proc</code>. </dd> |
| 132 |
<dd> |
| 133 |
<code>NULL</code> if none could be found.</dd></dl> |
| 134 |
<p>Topology <code class="param">topology</code> and processor handle <code class="param">proc</code> must match the local machine. I/O devices detection and the RSMI component must be enabled in the topology. If not, the locality of the object may still be found using <a class="el" href="#gaad2aed9762f04f179892f4176b21c00c" title="Get the CPU set of logical processors that are physically close to AMD GPU device whose index is dv_i...">hwloc_amdsmi_get_device_cpuset()</a>.</p> |
| 135 |
<dl class="section note"><dt>Note</dt><dd>The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out). </dd></dl> |
| 136 |
|
| 137 |
</div> |
| 138 |
</div> |
| 139 |
<a id="ga681a60045a44ee4641647cb4ceb72221" name="ga681a60045a44ee4641647cb4ceb72221"></a> |
| 140 |
<h2 class="memtitle"><span class="permalink"><a href="#ga681a60045a44ee4641647cb4ceb72221">◆ </a></span>hwloc_amdsmi_get_device_osdev_by_index()</h2> |
| 141 |
|
| 142 |
<div class="memitem"> |
| 143 |
<div class="memproto"> |
| 144 |
<table class="mlabels"> |
| 145 |
<tr> |
| 146 |
<td class="mlabels-left"> |
| 147 |
<table class="memname"> |
| 148 |
<tr> |
| 149 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_amdsmi_get_device_osdev_by_index </td> |
| 150 |
<td>(</td> |
| 151 |
<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> |
| 152 |
</tr> |
| 153 |
<tr> |
| 154 |
<td class="paramkey"></td> |
| 155 |
<td></td> |
| 156 |
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>hip_id</em></span> )</td> |
| 157 |
</tr> |
| 158 |
</table> |
| 159 |
</td> |
| 160 |
<td class="mlabels-right"> |
| 161 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 162 |
</tr> |
| 163 |
</table> |
| 164 |
</div><div class="memdoc"> |
| 165 |
|
| 166 |
<p>Get the hwloc OS device object corresponding to the AMD GPU device whose HIP index is <code class="param">hip_id</code>. </p> |
| 167 |
<dl class="section return"><dt>Returns</dt><dd>The hwloc OS device object describing the AMD GPU device whose HIP index is <code class="param">hip_id</code>. </dd> |
| 168 |
<dd> |
| 169 |
<code>NULL</code> if none could be found.</dd></dl> |
| 170 |
<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 RSMI component must be enabled in the topology.</p> |
| 171 |
<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></dl> |
| 172 |
|
| 173 |
</div> |
| 174 |
</div> |
| 175 |
</div><!-- contents --> |
| 176 |
<!-- start footer part --> |
| 177 |
<hr class="footer"/><address class="footer"><small> |
| 178 |
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 |
| 179 |
</small></address> |
| 180 |
</div><!-- doc-content --> |
| 181 |
</body> |
| 182 |
</html> |