| 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): rsmi.h Source File</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 id="nav-path" class="navpath"> |
| 43 |
<ul> |
| 44 |
<li class="navelem"><a href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a href="dir_5cb306d949c7931a3b6c77517393dd34.html">hwloc</a></li> </ul> |
| 45 |
</div> |
| 46 |
</div><!-- top --> |
| 47 |
<div id="doc-content"> |
| 48 |
<div class="header"> |
| 49 |
<div class="headertitle"><div class="title">rsmi.h</div></div> |
| 50 |
</div><!--header--> |
| 51 |
<div class="contents"> |
| 52 |
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/*</span></div> |
| 53 |
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div> |
| 54 |
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> * Copyright © 2012-2023 Inria. All rights reserved.</span></div> |
| 55 |
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> * Copyright (c) 2020, Advanced Micro Devices, Inc. All rights reserved.</span></div> |
| 56 |
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> * Written by Advanced Micro Devices,</span></div> |
| 57 |
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> * See COPYING in top-level directory.</span></div> |
| 58 |
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"> */</span></div> |
| 59 |
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span></div> |
| 60 |
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div> |
| 61 |
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#ifndef HWLOC_RSMI_H</span></div> |
| 62 |
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#define HWLOC_RSMI_H</span></div> |
| 63 |
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div> |
| 64 |
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include "hwloc.h"</span></div> |
| 65 |
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include "hwloc/autogen/config.h"</span></div> |
| 66 |
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include "hwloc/helper.h"</span></div> |
| 67 |
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#ifdef HWLOC_LINUX_SYS</span></div> |
| 68 |
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include "hwloc/linux.h"</span></div> |
| 69 |
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#endif</span></div> |
| 70 |
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> </div> |
| 71 |
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <rocm_smi/rocm_smi.h></span></div> |
| 72 |
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div> |
| 73 |
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div> |
| 74 |
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#ifdef __cplusplus</span></div> |
| 75 |
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div> |
| 76 |
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#endif</span></div> |
| 77 |
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div> |
| 78 |
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span></div> |
| 79 |
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span></div> |
| 80 |
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="keyword">static</span> __hwloc_inline <span class="keywordtype">int</span></div> |
| 81 |
<div class="foldopen" id="foldopen00064" data-start="{" data-end="}"> |
| 82 |
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="a00208.html#ga1786122b0fe11fbc416095aa3647f5d0"> 64</a></span><a class="code hl_function" href="a00208.html#ga1786122b0fe11fbc416095aa3647f5d0">hwloc_rsmi_get_device_cpuset</a>(<a class="code hl_typedef" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology __hwloc_attribute_unused,</div> |
| 83 |
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> uint32_t dv_ind, <a class="code hl_typedef" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set)</div> |
| 84 |
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span>{</div> |
| 85 |
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="preprocessor">#ifdef HWLOC_LINUX_SYS</span></div> |
| 86 |
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">/* If we're on Linux, use the sysfs mechanism to get the local cpus */</span></div> |
| 87 |
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span><span class="preprocessor">#define HWLOC_RSMI_DEVICE_SYSFS_PATH_MAX 128</span></div> |
| 88 |
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordtype">char</span> path[HWLOC_RSMI_DEVICE_SYSFS_PATH_MAX];</div> |
| 89 |
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> rsmi_status_t ret;</div> |
| 90 |
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> uint64_t bdfid = 0;</div> |
| 91 |
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">unsigned</span> domain, device, bus;</div> |
| 92 |
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div> |
| 93 |
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="a00176.html#ga68ffdcfd9175cdf40709801092f18017">hwloc_topology_is_thissystem</a>(topology)) {</div> |
| 94 |
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> errno = EINVAL;</div> |
| 95 |
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">return</span> -1;</div> |
| 96 |
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> }</div> |
| 97 |
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div> |
| 98 |
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> ret = rsmi_dev_pci_id_get(dv_ind, &bdfid);</div> |
| 99 |
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="keywordflow">if</span> (RSMI_STATUS_SUCCESS != ret) {</div> |
| 100 |
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> errno = EINVAL;</div> |
| 101 |
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">return</span> -1;</div> |
| 102 |
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> }</div> |
| 103 |
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> domain = (bdfid>>32) & 0xffffffff;</div> |
| 104 |
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> bus = ((bdfid & 0xffff)>>8) & 0xff;</div> |
| 105 |
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> device = ((bdfid & 0xff)>>3) & 0x1f;</div> |
| 106 |
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div> |
| 107 |
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> sprintf(path, <span class="stringliteral">"/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus"</span>, domain, bus, device);</div> |
| 108 |
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="a00198.html#gaf72d83e273803226ce772973e37b85de">hwloc_linux_read_path_as_cpumask</a>(path, set) < 0</div> |
| 109 |
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> || <a class="code hl_function" href="a00188.html#ga5b64be28f5a7176ed8ad0d6a90bdf108">hwloc_bitmap_iszero</a>(set))</div> |
| 110 |
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_function" href="a00188.html#ga72a29824798b48784b8217471ec8f14c">hwloc_bitmap_copy</a>(set, <a class="code hl_function" href="a00185.html#gaee30e03391c1ed7dfd617fb5c7bbb033">hwloc_topology_get_complete_cpuset</a>(topology));</div> |
| 111 |
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="preprocessor">#else</span></div> |
| 112 |
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="comment">/* Non-Linux systems simply get a full cpuset */</span></div> |
| 113 |
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_function" href="a00188.html#ga72a29824798b48784b8217471ec8f14c">hwloc_bitmap_copy</a>(set, <a class="code hl_function" href="a00185.html#gaee30e03391c1ed7dfd617fb5c7bbb033">hwloc_topology_get_complete_cpuset</a>(topology));</div> |
| 114 |
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="preprocessor">#endif</span></div> |
| 115 |
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keywordflow">return</span> 0;</div> |
| 116 |
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span>}</div> |
| 117 |
</div> |
| 118 |
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span></div> |
| 119 |
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="keyword">static</span> __hwloc_inline <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></div> |
| 120 |
<div class="foldopen" id="foldopen00116" data-start="{" data-end="}"> |
| 121 |
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="a00208.html#ga8646afda02b80e3415954f399dfa3793"> 116</a></span><a class="code hl_function" href="a00208.html#ga8646afda02b80e3415954f399dfa3793">hwloc_rsmi_get_device_osdev_by_index</a>(<a class="code hl_typedef" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, uint32_t dv_ind)</div> |
| 122 |
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>{</div> |
| 123 |
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> osdev = NULL;</div> |
| 124 |
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">while</span> ((osdev = <a class="code hl_function" href="a00187.html#ga17bba843ffa24978505961f104ee2efb">hwloc_get_next_osdev</a>(topology, osdev)) != NULL) {</div> |
| 125 |
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">if</span> (<a class="code hl_enumvalue" href="a00167.html#gga64f5d539df299c97ae80ce53fc4b56c0aa3a09798ef2836abb236dc3a645ffc90">HWLOC_OBJ_OSDEV_GPU</a> == osdev-><a class="code hl_variable" href="a00224.html#accd40e29f71f19e88db62ea3df02adc8">attr</a>-><a class="code hl_variable" href="a00228.html#aaf7a5c38b5185703ff18c46ad2761dcf">osdev</a>.<a class="code hl_variable" href="a00268.html#a31e019e27e54ac6138d04be639bb96f9">type</a></div> |
| 126 |
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> && osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a></div> |
| 127 |
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> && !strncmp(<span class="stringliteral">"rsmi"</span>, osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a>, 4)</div> |
| 128 |
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> && atoi(osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a> + 4) == (<span class="keywordtype">int</span>) dv_ind)</div> |
| 129 |
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">return</span> osdev;</div> |
| 130 |
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div> |
| 131 |
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keywordflow">return</span> NULL;</div> |
| 132 |
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span>}</div> |
| 133 |
</div> |
| 134 |
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span></div> |
| 135 |
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="keyword">static</span> __hwloc_inline <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></div> |
| 136 |
<div class="foldopen" id="foldopen00145" data-start="{" data-end="}"> |
| 137 |
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"><a class="line" href="a00208.html#ga3761f80526223eefcf18bf6b775176d1"> 145</a></span><a class="code hl_function" href="a00208.html#ga3761f80526223eefcf18bf6b775176d1">hwloc_rsmi_get_device_osdev</a>(<a class="code hl_typedef" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, uint32_t dv_ind)</div> |
| 138 |
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span>{</div> |
| 139 |
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> osdev;</div> |
| 140 |
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> rsmi_status_t ret;</div> |
| 141 |
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> uint64_t bdfid = 0;</div> |
| 142 |
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordtype">unsigned</span> domain, device, bus, func;</div> |
| 143 |
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> uint64_t id;</div> |
| 144 |
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keywordtype">char</span> uuid[64];</div> |
| 145 |
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div> |
| 146 |
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="a00176.html#ga68ffdcfd9175cdf40709801092f18017">hwloc_topology_is_thissystem</a>(topology)) {</div> |
| 147 |
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> errno = EINVAL;</div> |
| 148 |
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keywordflow">return</span> NULL;</div> |
| 149 |
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> }</div> |
| 150 |
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div> |
| 151 |
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> ret = rsmi_dev_pci_id_get(dv_ind, &bdfid);</div> |
| 152 |
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keywordflow">if</span> (RSMI_STATUS_SUCCESS != ret) {</div> |
| 153 |
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> errno = EINVAL;</div> |
| 154 |
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keywordflow">return</span> NULL;</div> |
| 155 |
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> }</div> |
| 156 |
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> domain = (bdfid>>32) & 0xffffffff;</div> |
| 157 |
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> bus = ((bdfid & 0xffff)>>8) & 0xff;</div> |
| 158 |
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> device = ((bdfid & 0xff)>>3) & 0x1f;</div> |
| 159 |
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> func = bdfid & 0x7;</div> |
| 160 |
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> </div> |
| 161 |
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> ret = rsmi_dev_unique_id_get(dv_ind, &<span class="keywordtype">id</span>);</div> |
| 162 |
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">if</span> (RSMI_STATUS_SUCCESS != ret)</div> |
| 163 |
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> uuid[0] = <span class="charliteral">'\0'</span>;</div> |
| 164 |
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordflow">else</span></div> |
| 165 |
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> sprintf(uuid, <span class="stringliteral">"%lx"</span>, <span class="keywordtype">id</span>);</div> |
| 166 |
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div> |
| 167 |
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> osdev = NULL;</div> |
| 168 |
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="keywordflow">while</span> ((osdev = <a class="code hl_function" href="a00187.html#ga17bba843ffa24978505961f104ee2efb">hwloc_get_next_osdev</a>(topology, osdev)) != NULL) {</div> |
| 169 |
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> pcidev = osdev-><a class="code hl_variable" href="a00224.html#adc494f6aed939992be1c55cca5822900">parent</a>;</div> |
| 170 |
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *info;</div> |
| 171 |
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div> |
| 172 |
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> <span class="keywordflow">if</span> (strncmp(osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a>, <span class="stringliteral">"rsmi"</span>, 4))</div> |
| 173 |
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="keywordflow">continue</span>;</div> |
| 174 |
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> </div> |
| 175 |
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="keywordflow">if</span> (pcidev</div> |
| 176 |
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> && pcidev-><a class="code hl_variable" href="a00224.html#acc4f0803f244867e68fe0036800be5de">type</a> == <a class="code hl_enumvalue" href="a00167.html#ggacd37bb612667dc437d66bfb175a8dc55a5d8117a54df1fbd3606ab19e42cb0ea9">HWLOC_OBJ_PCI_DEVICE</a></div> |
| 177 |
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> && pcidev-><a class="code hl_variable" href="a00224.html#accd40e29f71f19e88db62ea3df02adc8">attr</a>-><a class="code hl_variable" href="a00228.html#a0b66da7ab072f7c016f8ed86701f5a7c">pcidev</a>.<a class="code hl_variable" href="a00248.html#a8fba44988deb98613c1505a4019a34dc">domain</a> == domain</div> |
| 178 |
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> && pcidev-><a class="code hl_variable" href="a00224.html#accd40e29f71f19e88db62ea3df02adc8">attr</a>-><a class="code hl_variable" href="a00228.html#a0b66da7ab072f7c016f8ed86701f5a7c">pcidev</a>.<a class="code hl_variable" href="a00248.html#aae99e035e8d1387d7b8768aaa8eceb0a">bus</a> == bus</div> |
| 179 |
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> && pcidev-><a class="code hl_variable" href="a00224.html#accd40e29f71f19e88db62ea3df02adc8">attr</a>-><a class="code hl_variable" href="a00228.html#a0b66da7ab072f7c016f8ed86701f5a7c">pcidev</a>.<a class="code hl_variable" href="a00248.html#a3d70c84a12f7e93d14c8d47bf4fd9dc5">dev</a> == device</div> |
| 180 |
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> && pcidev-><a class="code hl_variable" href="a00224.html#accd40e29f71f19e88db62ea3df02adc8">attr</a>-><a class="code hl_variable" href="a00228.html#a0b66da7ab072f7c016f8ed86701f5a7c">pcidev</a>.<a class="code hl_variable" href="a00248.html#a695f32df53f4ef728670bfcf31b74e0f">func</a> == func)</div> |
| 181 |
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keywordflow">return</span> osdev;</div> |
| 182 |
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> </div> |
| 183 |
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> info = <a class="code hl_function" href="a00172.html#ga840c03c835d41cd6f4d91625c25a238d">hwloc_obj_get_info_by_name</a>(osdev, <span class="stringliteral">"AMDUUID"</span>);</div> |
| 184 |
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="keywordflow">if</span> (info && !strcmp(info, uuid))</div> |
| 185 |
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> <span class="keywordflow">return</span> osdev;</div> |
| 186 |
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> }</div> |
| 187 |
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div> |
| 188 |
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="keywordflow">return</span> NULL;</div> |
| 189 |
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span>}</div> |
| 190 |
</div> |
| 191 |
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span></div> |
| 192 |
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> </div> |
| 193 |
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> </div> |
| 194 |
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span><span class="preprocessor">#ifdef __cplusplus</span></div> |
| 195 |
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span>} <span class="comment">/* extern "C" */</span></div> |
| 196 |
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span><span class="preprocessor">#endif</span></div> |
| 197 |
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> </div> |
| 198 |
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> </div> |
| 199 |
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="preprocessor">#endif </span><span class="comment">/* HWLOC_RSMI_H */</span><span class="preprocessor"></span></div> |
| 200 |
<div class="ttc" id="aa00166_html_ga4bbf39b68b6f568fb92739e7c0ea7801"><div class="ttname"><a href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a></div><div class="ttdeci">hwloc_bitmap_t hwloc_cpuset_t</div><div class="ttdoc">A CPU set is a bitmap whose bits are set according to CPU physical OS indexes.</div><div class="ttdef"><b>Definition</b> hwloc.h:165</div></div> |
| 201 |
<div class="ttc" id="aa00167_html_gga64f5d539df299c97ae80ce53fc4b56c0aa3a09798ef2836abb236dc3a645ffc90"><div class="ttname"><a href="a00167.html#gga64f5d539df299c97ae80ce53fc4b56c0aa3a09798ef2836abb236dc3a645ffc90">HWLOC_OBJ_OSDEV_GPU</a></div><div class="ttdeci">@ HWLOC_OBJ_OSDEV_GPU</div><div class="ttdoc">Operating system GPU device. For instance ":0.0" for a GL display, "card0" for a Linux DRM device.</div><div class="ttdef"><b>Definition</b> hwloc.h:380</div></div> |
| 202 |
<div class="ttc" id="aa00167_html_ggacd37bb612667dc437d66bfb175a8dc55a5d8117a54df1fbd3606ab19e42cb0ea9"><div class="ttname"><a href="a00167.html#ggacd37bb612667dc437d66bfb175a8dc55a5d8117a54df1fbd3606ab19e42cb0ea9">HWLOC_OBJ_PCI_DEVICE</a></div><div class="ttdeci">@ HWLOC_OBJ_PCI_DEVICE</div><div class="ttdoc">PCI device (filtered out by default).</div><div class="ttdef"><b>Definition</b> hwloc.h:300</div></div> |
| 203 |
<div class="ttc" id="aa00168_html_ga79b8ab56877ef99ac59b833203391c7d"><div class="ttname"><a href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></div><div class="ttdeci">struct hwloc_obj * hwloc_obj_t</div><div class="ttdoc">Convenience typedef; a pointer to a struct hwloc_obj.</div><div class="ttdef"><b>Definition</b> hwloc.h:637</div></div> |
| 204 |
<div class="ttc" id="aa00169_html_ga9d1e76ee15a7dee158b786c30b6a6e38"><div class="ttname"><a href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></div><div class="ttdeci">struct hwloc_topology * hwloc_topology_t</div><div class="ttdoc">Topology context.</div><div class="ttdef"><b>Definition</b> hwloc.h:748</div></div> |
| 205 |
<div class="ttc" id="aa00172_html_ga840c03c835d41cd6f4d91625c25a238d"><div class="ttname"><a href="a00172.html#ga840c03c835d41cd6f4d91625c25a238d">hwloc_obj_get_info_by_name</a></div><div class="ttdeci">const char * hwloc_obj_get_info_by_name(hwloc_obj_t obj, const char *name)</div><div class="ttdoc">Search the given name in object infos and return the corresponding value.</div></div> |
| 206 |
<div class="ttc" id="aa00176_html_ga68ffdcfd9175cdf40709801092f18017"><div class="ttname"><a href="a00176.html#ga68ffdcfd9175cdf40709801092f18017">hwloc_topology_is_thissystem</a></div><div class="ttdeci">int hwloc_topology_is_thissystem(hwloc_topology_t restrict topology)</div><div class="ttdoc">Does the topology context come from this system?</div></div> |
| 207 |
<div class="ttc" id="aa00185_html_gaee30e03391c1ed7dfd617fb5c7bbb033"><div class="ttname"><a href="a00185.html#gaee30e03391c1ed7dfd617fb5c7bbb033">hwloc_topology_get_complete_cpuset</a></div><div class="ttdeci">hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)</div><div class="ttdoc">Get complete CPU set.</div></div> |
| 208 |
<div class="ttc" id="aa00187_html_ga17bba843ffa24978505961f104ee2efb"><div class="ttname"><a href="a00187.html#ga17bba843ffa24978505961f104ee2efb">hwloc_get_next_osdev</a></div><div class="ttdeci">hwloc_obj_t hwloc_get_next_osdev(hwloc_topology_t topology, hwloc_obj_t prev)</div><div class="ttdoc">Get the next OS device in the system.</div><div class="ttdef"><b>Definition</b> helper.h:1291</div></div> |
| 209 |
<div class="ttc" id="aa00188_html_ga5b64be28f5a7176ed8ad0d6a90bdf108"><div class="ttname"><a href="a00188.html#ga5b64be28f5a7176ed8ad0d6a90bdf108">hwloc_bitmap_iszero</a></div><div class="ttdeci">int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap)</div><div class="ttdoc">Test whether bitmap bitmap is empty.</div></div> |
| 210 |
<div class="ttc" id="aa00188_html_ga72a29824798b48784b8217471ec8f14c"><div class="ttname"><a href="a00188.html#ga72a29824798b48784b8217471ec8f14c">hwloc_bitmap_copy</a></div><div class="ttdeci">int hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src)</div><div class="ttdoc">Copy the contents of bitmap src into the already allocated bitmap dst.</div></div> |
| 211 |
<div class="ttc" id="aa00198_html_gaf72d83e273803226ce772973e37b85de"><div class="ttname"><a href="a00198.html#gaf72d83e273803226ce772973e37b85de">hwloc_linux_read_path_as_cpumask</a></div><div class="ttdeci">int hwloc_linux_read_path_as_cpumask(const char *path, hwloc_bitmap_t set)</div><div class="ttdoc">Convert a linux kernel cpumask file path into a hwloc bitmap set.</div></div> |
| 212 |
<div class="ttc" id="aa00208_html_ga1786122b0fe11fbc416095aa3647f5d0"><div class="ttname"><a href="a00208.html#ga1786122b0fe11fbc416095aa3647f5d0">hwloc_rsmi_get_device_cpuset</a></div><div class="ttdeci">int hwloc_rsmi_get_device_cpuset(hwloc_topology_t topology, uint32_t dv_ind, hwloc_cpuset_t set)</div><div class="ttdoc">Get the CPU set of logical processors that are physically close to AMD GPU device whose index is dv_i...</div><div class="ttdef"><b>Definition</b> rsmi.h:64</div></div> |
| 213 |
<div class="ttc" id="aa00208_html_ga3761f80526223eefcf18bf6b775176d1"><div class="ttname"><a href="a00208.html#ga3761f80526223eefcf18bf6b775176d1">hwloc_rsmi_get_device_osdev</a></div><div class="ttdeci">hwloc_obj_t hwloc_rsmi_get_device_osdev(hwloc_topology_t topology, uint32_t dv_ind)</div><div class="ttdoc">Get the hwloc OS device object corresponding to AMD GPU device, whose index is dv_ind.</div><div class="ttdef"><b>Definition</b> rsmi.h:145</div></div> |
| 214 |
<div class="ttc" id="aa00208_html_ga8646afda02b80e3415954f399dfa3793"><div class="ttname"><a href="a00208.html#ga8646afda02b80e3415954f399dfa3793">hwloc_rsmi_get_device_osdev_by_index</a></div><div class="ttdeci">hwloc_obj_t hwloc_rsmi_get_device_osdev_by_index(hwloc_topology_t topology, uint32_t dv_ind)</div><div class="ttdoc">Get the hwloc OS device object corresponding to the AMD GPU device whose index is dv_ind.</div><div class="ttdef"><b>Definition</b> rsmi.h:116</div></div> |
| 215 |
<div class="ttc" id="aa00224_html_abb709ec38f2970677e4e57d1d30be96d"><div class="ttname"><a href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">hwloc_obj::name</a></div><div class="ttdeci">char * name</div><div class="ttdoc">Object-specific name if any. Mostly used for identifying OS devices and Misc objects where a name str...</div><div class="ttdef"><b>Definition</b> hwloc.h:449</div></div> |
| 216 |
<div class="ttc" id="aa00224_html_acc4f0803f244867e68fe0036800be5de"><div class="ttname"><a href="a00224.html#acc4f0803f244867e68fe0036800be5de">hwloc_obj::type</a></div><div class="ttdeci">hwloc_obj_type_t type</div><div class="ttdoc">Type of object.</div><div class="ttdef"><b>Definition</b> hwloc.h:439</div></div> |
| 217 |
<div class="ttc" id="aa00224_html_accd40e29f71f19e88db62ea3df02adc8"><div class="ttname"><a href="a00224.html#accd40e29f71f19e88db62ea3df02adc8">hwloc_obj::attr</a></div><div class="ttdeci">union hwloc_obj_attr_u * attr</div><div class="ttdoc">Object type-specific Attributes, may be NULL if no attribute value was found.</div><div class="ttdef"><b>Definition</b> hwloc.h:456</div></div> |
| 218 |
<div class="ttc" id="aa00224_html_adc494f6aed939992be1c55cca5822900"><div class="ttname"><a href="a00224.html#adc494f6aed939992be1c55cca5822900">hwloc_obj::parent</a></div><div class="ttdeci">struct hwloc_obj * parent</div><div class="ttdoc">Parent, NULL if root (Machine object).</div><div class="ttdef"><b>Definition</b> hwloc.h:487</div></div> |
| 219 |
<div class="ttc" id="aa00228_html_a0b66da7ab072f7c016f8ed86701f5a7c"><div class="ttname"><a href="a00228.html#a0b66da7ab072f7c016f8ed86701f5a7c">hwloc_obj_attr_u::pcidev</a></div><div class="ttdeci">struct hwloc_obj_attr_u::hwloc_pcidev_attr_s pcidev</div></div> |
| 220 |
<div class="ttc" id="aa00228_html_aaf7a5c38b5185703ff18c46ad2761dcf"><div class="ttname"><a href="a00228.html#aaf7a5c38b5185703ff18c46ad2761dcf">hwloc_obj_attr_u::osdev</a></div><div class="ttdeci">struct hwloc_obj_attr_u::hwloc_osdev_attr_s osdev</div></div> |
| 221 |
<div class="ttc" id="aa00248_html_a3d70c84a12f7e93d14c8d47bf4fd9dc5"><div class="ttname"><a href="a00248.html#a3d70c84a12f7e93d14c8d47bf4fd9dc5">hwloc_obj_attr_u::hwloc_pcidev_attr_s::dev</a></div><div class="ttdeci">unsigned char dev</div><div class="ttdoc">Device number (zz in the PCI BDF notation xxxx:yy:zz.t).</div><div class="ttdef"><b>Definition</b> hwloc.h:683</div></div> |
| 222 |
<div class="ttc" id="aa00248_html_a695f32df53f4ef728670bfcf31b74e0f"><div class="ttname"><a href="a00248.html#a695f32df53f4ef728670bfcf31b74e0f">hwloc_obj_attr_u::hwloc_pcidev_attr_s::func</a></div><div class="ttdeci">unsigned char func</div><div class="ttdoc">Function number (t in the PCI BDF notation xxxx:yy:zz.t).</div><div class="ttdef"><b>Definition</b> hwloc.h:684</div></div> |
| 223 |
<div class="ttc" id="aa00248_html_a8fba44988deb98613c1505a4019a34dc"><div class="ttname"><a href="a00248.html#a8fba44988deb98613c1505a4019a34dc">hwloc_obj_attr_u::hwloc_pcidev_attr_s::domain</a></div><div class="ttdeci">unsigned short domain</div><div class="ttdoc">Domain number (xxxx in the PCI BDF notation xxxx:yy:zz.t). Only 16bits PCI domains are supported by d...</div><div class="ttdef"><b>Definition</b> hwloc.h:676</div></div> |
| 224 |
<div class="ttc" id="aa00248_html_aae99e035e8d1387d7b8768aaa8eceb0a"><div class="ttname"><a href="a00248.html#aae99e035e8d1387d7b8768aaa8eceb0a">hwloc_obj_attr_u::hwloc_pcidev_attr_s::bus</a></div><div class="ttdeci">unsigned char bus</div><div class="ttdoc">Bus number (yy in the PCI BDF notation xxxx:yy:zz.t).</div><div class="ttdef"><b>Definition</b> hwloc.h:682</div></div> |
| 225 |
<div class="ttc" id="aa00268_html_a31e019e27e54ac6138d04be639bb96f9"><div class="ttname"><a href="a00268.html#a31e019e27e54ac6138d04be639bb96f9">hwloc_obj_attr_u::hwloc_osdev_attr_s::type</a></div><div class="ttdeci">hwloc_obj_osdev_type_t type</div><div class="ttdef"><b>Definition</b> hwloc.h:722</div></div> |
| 226 |
</div><!-- fragment --></div><!-- contents --> |
| 227 |
<!-- start footer part --> |
| 228 |
<hr class="footer"/><address class="footer"><small> |
| 229 |
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 |
| 230 |
</small></address> |
| 231 |
</div><!-- doc-content --> |
| 232 |
</body> |
| 233 |
</html> |