| 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): nvml.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">nvml.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"> * See COPYING in top-level directory.</span></div> |
| 56 |
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> */</span></div> |
| 57 |
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span></div> |
| 58 |
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div> |
| 59 |
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#ifndef HWLOC_NVML_H</span></div> |
| 60 |
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#define HWLOC_NVML_H</span></div> |
| 61 |
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> </div> |
| 62 |
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include "hwloc.h"</span></div> |
| 63 |
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include "hwloc/autogen/config.h"</span></div> |
| 64 |
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include "hwloc/helper.h"</span></div> |
| 65 |
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#ifdef HWLOC_LINUX_SYS</span></div> |
| 66 |
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include "hwloc/linux.h"</span></div> |
| 67 |
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#endif</span></div> |
| 68 |
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div> |
| 69 |
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include <nvml.h></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> </div> |
| 72 |
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#ifdef __cplusplus</span></div> |
| 73 |
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div> |
| 74 |
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#endif</span></div> |
| 75 |
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div> |
| 76 |
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span></div> |
| 77 |
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span></div> |
| 78 |
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="keyword">static</span> __hwloc_inline <span class="keywordtype">int</span></div> |
| 79 |
<div class="foldopen" id="foldopen00060" data-start="{" data-end="}"> |
| 80 |
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="a00206.html#gaad455019ab82cc36ec0c27d6d31d760c"> 60</a></span><a class="code hl_function" href="a00206.html#gaad455019ab82cc36ec0c27d6d31d760c">hwloc_nvml_get_device_cpuset</a>(<a class="code hl_typedef" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology __hwloc_attribute_unused,</div> |
| 81 |
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> nvmlDevice_t device, <a class="code hl_typedef" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set)</div> |
| 82 |
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span>{</div> |
| 83 |
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span><span class="preprocessor">#ifdef HWLOC_LINUX_SYS</span></div> |
| 84 |
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="comment">/* If we're on Linux, use the sysfs mechanism to get the local cpus */</span></div> |
| 85 |
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span><span class="preprocessor">#define HWLOC_NVML_DEVICE_SYSFS_PATH_MAX 128</span></div> |
| 86 |
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">char</span> path[HWLOC_NVML_DEVICE_SYSFS_PATH_MAX];</div> |
| 87 |
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> nvmlReturn_t nvres;</div> |
| 88 |
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> nvmlPciInfo_t pci;</div> |
| 89 |
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div> |
| 90 |
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="a00176.html#ga68ffdcfd9175cdf40709801092f18017">hwloc_topology_is_thissystem</a>(topology)) {</div> |
| 91 |
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> errno = EINVAL;</div> |
| 92 |
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">return</span> -1;</div> |
| 93 |
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> }</div> |
| 94 |
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div> |
| 95 |
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> nvres = nvmlDeviceGetPciInfo(device, &pci);</div> |
| 96 |
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="keywordflow">if</span> (NVML_SUCCESS != nvres) {</div> |
| 97 |
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> errno = EINVAL;</div> |
| 98 |
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keywordflow">return</span> -1;</div> |
| 99 |
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> }</div> |
| 100 |
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> </div> |
| 101 |
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> sprintf(path, <span class="stringliteral">"/sys/bus/pci/devices/%04x:%02x:%02x.0/local_cpus"</span>, pci.domain, pci.bus, pci.device);</div> |
| 102 |
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</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> |
| 103 |
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> || <a class="code hl_function" href="a00188.html#ga5b64be28f5a7176ed8ad0d6a90bdf108">hwloc_bitmap_iszero</a>(set))</div> |
| 104 |
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</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> |
| 105 |
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="preprocessor">#else</span></div> |
| 106 |
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="comment">/* Non-Linux systems simply get a full cpuset */</span></div> |
| 107 |
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</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> |
| 108 |
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span><span class="preprocessor">#endif</span></div> |
| 109 |
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">return</span> 0;</div> |
| 110 |
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span>}</div> |
| 111 |
</div> |
| 112 |
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span></div> |
| 113 |
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="keyword">static</span> __hwloc_inline <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></div> |
| 114 |
<div class="foldopen" id="foldopen00106" data-start="{" data-end="}"> |
| 115 |
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="a00206.html#gaf2ff5cb6760289199d3b9947ae662a80"> 106</a></span><a class="code hl_function" href="a00206.html#gaf2ff5cb6760289199d3b9947ae662a80">hwloc_nvml_get_device_osdev_by_index</a>(<a class="code hl_typedef" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <span class="keywordtype">unsigned</span> idx)</div> |
| 116 |
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span>{</div> |
| 117 |
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> osdev = NULL;</div> |
| 118 |
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</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> |
| 119 |
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</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> |
| 120 |
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> && osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a></div> |
| 121 |
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> && !strncmp(<span class="stringliteral">"nvml"</span>, osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a>, 4)</div> |
| 122 |
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> && atoi(osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a> + 4) == (<span class="keywordtype">int</span>) idx)</div> |
| 123 |
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keywordflow">return</span> osdev;</div> |
| 124 |
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div> |
| 125 |
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="keywordflow">return</span> NULL;</div> |
| 126 |
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span>}</div> |
| 127 |
</div> |
| 128 |
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span></div> |
| 129 |
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span><span class="keyword">static</span> __hwloc_inline <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></div> |
| 130 |
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}"> |
| 131 |
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="a00206.html#ga938521c26b11604303192f9409e44932"> 133</a></span><a class="code hl_function" href="a00206.html#ga938521c26b11604303192f9409e44932">hwloc_nvml_get_device_osdev</a>(<a class="code hl_typedef" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, nvmlDevice_t device)</div> |
| 132 |
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>{</div> |
| 133 |
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <a class="code hl_typedef" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> osdev;</div> |
| 134 |
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> nvmlReturn_t nvres;</div> |
| 135 |
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> nvmlPciInfo_t pci;</div> |
| 136 |
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keywordtype">char</span> uuid[64];</div> |
| 137 |
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div> |
| 138 |
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="keywordflow">if</span> (!<a class="code hl_function" href="a00176.html#ga68ffdcfd9175cdf40709801092f18017">hwloc_topology_is_thissystem</a>(topology)) {</div> |
| 139 |
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> errno = EINVAL;</div> |
| 140 |
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordflow">return</span> NULL;</div> |
| 141 |
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> }</div> |
| 142 |
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> </div> |
| 143 |
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> nvres = nvmlDeviceGetPciInfo(device, &pci);</div> |
| 144 |
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">if</span> (NVML_SUCCESS != nvres)</div> |
| 145 |
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordflow">return</span> NULL;</div> |
| 146 |
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div> |
| 147 |
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> nvres = nvmlDeviceGetUUID(device, uuid, <span class="keyword">sizeof</span>(uuid));</div> |
| 148 |
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">if</span> (NVML_SUCCESS != nvres)</div> |
| 149 |
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> uuid[0] = <span class="charliteral">'\0'</span>;</div> |
| 150 |
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div> |
| 151 |
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> osdev = NULL;</div> |
| 152 |
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</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> |
| 153 |
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</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> |
| 154 |
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *info;</div> |
| 155 |
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div> |
| 156 |
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">if</span> (strncmp(osdev-><a class="code hl_variable" href="a00224.html#abb709ec38f2970677e4e57d1d30be96d">name</a>, <span class="stringliteral">"nvml"</span>, 4))</div> |
| 157 |
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">continue</span>;</div> |
| 158 |
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> </div> |
| 159 |
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="keywordflow">if</span> (pcidev</div> |
| 160 |
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</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> |
| 161 |
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</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> == pci.domain</div> |
| 162 |
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</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> == pci.bus</div> |
| 163 |
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</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> == pci.device</div> |
| 164 |
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</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> == 0)</div> |
| 165 |
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">return</span> osdev;</div> |
| 166 |
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> </div> |
| 167 |
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> info = <a class="code hl_function" href="a00172.html#ga840c03c835d41cd6f4d91625c25a238d">hwloc_obj_get_info_by_name</a>(osdev, <span class="stringliteral">"NVIDIAUUID"</span>);</div> |
| 168 |
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keywordflow">if</span> (info && !strcmp(info, uuid))</div> |
| 169 |
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordflow">return</span> osdev;</div> |
| 170 |
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> }</div> |
| 171 |
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> </div> |
| 172 |
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordflow">return</span> NULL;</div> |
| 173 |
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span>}</div> |
| 174 |
</div> |
| 175 |
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span></div> |
| 176 |
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> </div> |
| 177 |
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div> |
| 178 |
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span><span class="preprocessor">#ifdef __cplusplus</span></div> |
| 179 |
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span>} <span class="comment">/* extern "C" */</span></div> |
| 180 |
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="preprocessor">#endif</span></div> |
| 181 |
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> </div> |
| 182 |
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> </div> |
| 183 |
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span><span class="preprocessor">#endif </span><span class="comment">/* HWLOC_NVML_H */</span><span class="preprocessor"></span></div> |
| 184 |
<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> |
| 185 |
<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> |
| 186 |
<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> |
| 187 |
<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> |
| 188 |
<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> |
| 189 |
<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> |
| 190 |
<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> |
| 191 |
<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> |
| 192 |
<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> |
| 193 |
<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> |
| 194 |
<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> |
| 195 |
<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> |
| 196 |
<div class="ttc" id="aa00206_html_ga938521c26b11604303192f9409e44932"><div class="ttname"><a href="a00206.html#ga938521c26b11604303192f9409e44932">hwloc_nvml_get_device_osdev</a></div><div class="ttdeci">hwloc_obj_t hwloc_nvml_get_device_osdev(hwloc_topology_t topology, nvmlDevice_t device)</div><div class="ttdoc">Get the hwloc OS device object corresponding to NVML device device.</div><div class="ttdef"><b>Definition</b> nvml.h:133</div></div> |
| 197 |
<div class="ttc" id="aa00206_html_gaad455019ab82cc36ec0c27d6d31d760c"><div class="ttname"><a href="a00206.html#gaad455019ab82cc36ec0c27d6d31d760c">hwloc_nvml_get_device_cpuset</a></div><div class="ttdeci">int hwloc_nvml_get_device_cpuset(hwloc_topology_t topology, nvmlDevice_t device, hwloc_cpuset_t set)</div><div class="ttdoc">Get the CPU set of processors that are physically close to NVML device device.</div><div class="ttdef"><b>Definition</b> nvml.h:60</div></div> |
| 198 |
<div class="ttc" id="aa00206_html_gaf2ff5cb6760289199d3b9947ae662a80"><div class="ttname"><a href="a00206.html#gaf2ff5cb6760289199d3b9947ae662a80">hwloc_nvml_get_device_osdev_by_index</a></div><div class="ttdeci">hwloc_obj_t hwloc_nvml_get_device_osdev_by_index(hwloc_topology_t topology, unsigned idx)</div><div class="ttdoc">Get the hwloc OS device object corresponding to the NVML device whose index is idx.</div><div class="ttdef"><b>Definition</b> nvml.h:106</div></div> |
| 199 |
<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> |
| 200 |
<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> |
| 201 |
<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> |
| 202 |
<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> |
| 203 |
<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> |
| 204 |
<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> |
| 205 |
<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> |
| 206 |
<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> |
| 207 |
<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> |
| 208 |
<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> |
| 209 |
<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> |
| 210 |
</div><!-- fragment --></div><!-- contents --> |
| 211 |
<!-- start footer part --> |
| 212 |
<hr class="footer"/><address class="footer"><small> |
| 213 |
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 |
| 214 |
</small></address> |
| 215 |
</div><!-- doc-content --> |
| 216 |
</body> |
| 217 |
</html> |