Debian Codegraph @

doc/doxygen-doc/html/a00203.html

raw
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 OpenCL</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">&#160;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 OpenCL </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:ga8517e9e9fbc25561bb82f591b2d4ec4f" id="r_ga8517e9e9fbc25561bb82f591b2d4ec4f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga8517e9e9fbc25561bb82f591b2d4ec4f">hwloc_opencl_get_device_pci_busid</a> (cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)</td></tr>
54 <tr class="memitem:ga7a440bdd8015737c4970fdcd4349fe7f" id="r_ga7a440bdd8015737c4970fdcd4349fe7f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga7a440bdd8015737c4970fdcd4349fe7f">hwloc_opencl_get_device_cpuset</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, cl_device_id device, <a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set)</td></tr>
55 <tr class="memitem:gae3d1e395ac0208c85860dfafe26c4dfc" id="r_gae3d1e395ac0208c85860dfafe26c4dfc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gae3d1e395ac0208c85860dfafe26c4dfc">hwloc_opencl_get_device_osdev_by_index</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, unsigned platform_index, unsigned device_index)</td></tr>
56 <tr class="memitem:gae0c20d8b43763abaff74e500ed4f1162" id="r_gae0c20d8b43763abaff74e500ed4f1162"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gae0c20d8b43763abaff74e500ed4f1162">hwloc_opencl_get_device_osdev</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, cl_device_id device)</td></tr>
57 </table>
58 <a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
59 <p>This interface offers ways to retrieve topology information about OpenCL devices.</p>
60 <p>Only AMD and NVIDIA OpenCL implementations currently offer useful locality information about their devices. </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="ga7a440bdd8015737c4970fdcd4349fe7f" name="ga7a440bdd8015737c4970fdcd4349fe7f"></a>
63 <h2 class="memtitle"><span class="permalink"><a href="#ga7a440bdd8015737c4970fdcd4349fe7f">&#9670;&#160;</a></span>hwloc_opencl_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_opencl_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">cl_device_id</td> <td class="paramname"><span class="paramname"><em>device</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>&#160;)</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 OpenCL device <code class="param">device</code>. </p>
95 <p>Store in <code class="param">set</code> the CPU-set describing the locality of the OpenCL device <code class="param">device</code>.</p>
96 <p>Topology <code class="param">topology</code> and device <code class="param">device</code> must match the local machine. I/O devices detection and the OpenCL 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="#gae0c20d8b43763abaff74e500ed4f1162" title="Get the hwloc OS device object corresponding to OpenCL device deviceX.">hwloc_opencl_get_device_osdev()</a> and <a class="el" href="#gae3d1e395ac0208c85860dfafe26c4dfc" title="Get the hwloc OS device object corresponding to the OpenCL device for the given indexes.">hwloc_opencl_get_device_osdev_by_index()</a>.</p>
98 <p>This function is currently only implemented in a meaningful way for Linux with the AMD or NVIDIA OpenCL implementation; 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 the device could not be found. </dd></dl>
102
103 </div>
104 </div>
105 <a id="gae0c20d8b43763abaff74e500ed4f1162" name="gae0c20d8b43763abaff74e500ed4f1162"></a>
106 <h2 class="memtitle"><span class="permalink"><a href="#gae0c20d8b43763abaff74e500ed4f1162">&#9670;&#160;</a></span>hwloc_opencl_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_opencl_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">cl_device_id</td> <td class="paramname"><span class="paramname"><em>device</em></span>&#160;)</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 OpenCL device <code class="param">deviceX</code>. </p>
133 <dl class="section return"><dt>Returns</dt><dd>The hwloc OS device object corresponding to the given OpenCL device <code class="param">device</code>. </dd>
134 <dd>
135 <code>NULL</code> if none could be found, for instance if required OpenCL attributes are not available.</dd></dl>
136 <p>This function currently only works on AMD and NVIDIA OpenCL devices that support relevant OpenCL extensions. <a class="el" href="#gae3d1e395ac0208c85860dfafe26c4dfc" title="Get the hwloc OS device object corresponding to the OpenCL device for the given indexes.">hwloc_opencl_get_device_osdev_by_index()</a> should be preferred whenever possible, i.e. when platform and device index are known.</p>
137 <p>Topology <code class="param">topology</code> and device <code class="param">device</code> must match the local machine. I/O devices detection and the OpenCL component must be enabled in the topology. If not, the locality of the object may still be found using <a class="el" href="#ga7a440bdd8015737c4970fdcd4349fe7f" title="Get the CPU set of processors that are physically close to OpenCL device device.">hwloc_opencl_get_device_cpuset()</a>.</p>
138 <dl class="section note"><dt>Note</dt><dd>This function cannot work if PCI devices are filtered out.</dd>
139 <dd>
140 The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out). </dd></dl>
141
142 </div>
143 </div>
144 <a id="gae3d1e395ac0208c85860dfafe26c4dfc" name="gae3d1e395ac0208c85860dfafe26c4dfc"></a>
145 <h2 class="memtitle"><span class="permalink"><a href="#gae3d1e395ac0208c85860dfafe26c4dfc">&#9670;&#160;</a></span>hwloc_opencl_get_device_osdev_by_index()</h2>
146
147 <div class="memitem">
148 <div class="memproto">
149 <table class="mlabels">
150 <tr>
151 <td class="mlabels-left">
152 <table class="memname">
153 <tr>
154 <td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_opencl_get_device_osdev_by_index </td>
155 <td>(</td>
156 <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>
157 </tr>
158 <tr>
159 <td class="paramkey"></td>
160 <td></td>
161 <td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>platform_index</em></span>, </td>
162 </tr>
163 <tr>
164 <td class="paramkey"></td>
165 <td></td>
166 <td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>device_index</em></span>&#160;)</td>
167 </tr>
168 </table>
169 </td>
170 <td class="mlabels-right">
171 <span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
172 </tr>
173 </table>
174 </div><div class="memdoc">
175
176 <p>Get the hwloc OS device object corresponding to the OpenCL device for the given indexes. </p>
177 <dl class="section return"><dt>Returns</dt><dd>The hwloc OS device object describing the OpenCL device whose platform index is <code class="param">platform_index</code>, and whose device index within this platform if <code class="param">device_index</code>. </dd>
178 <dd>
179 <code>NULL</code> if there is none.</dd></dl>
180 <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 OpenCL component must be enabled in the topology.</p>
181 <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>
182
183 </div>
184 </div>
185 <a id="ga8517e9e9fbc25561bb82f591b2d4ec4f" name="ga8517e9e9fbc25561bb82f591b2d4ec4f"></a>
186 <h2 class="memtitle"><span class="permalink"><a href="#ga8517e9e9fbc25561bb82f591b2d4ec4f">&#9670;&#160;</a></span>hwloc_opencl_get_device_pci_busid()</h2>
187
188 <div class="memitem">
189 <div class="memproto">
190 <table class="mlabels">
191 <tr>
192 <td class="mlabels-left">
193 <table class="memname">
194 <tr>
195 <td class="memname">int hwloc_opencl_get_device_pci_busid </td>
196 <td>(</td>
197 <td class="paramtype">cl_device_id</td> <td class="paramname"><span class="paramname"><em>device</em></span>, </td>
198 </tr>
199 <tr>
200 <td class="paramkey"></td>
201 <td></td>
202 <td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>domain</em></span>, </td>
203 </tr>
204 <tr>
205 <td class="paramkey"></td>
206 <td></td>
207 <td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>bus</em></span>, </td>
208 </tr>
209 <tr>
210 <td class="paramkey"></td>
211 <td></td>
212 <td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>dev</em></span>, </td>
213 </tr>
214 <tr>
215 <td class="paramkey"></td>
216 <td></td>
217 <td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>func</em></span>&#160;)</td>
218 </tr>
219 </table>
220 </td>
221 <td class="mlabels-right">
222 <span class="mlabels"><span class="mlabel inline">inline</span></span> </td>
223 </tr>
224 </table>
225 </div><div class="memdoc">
226
227 <p>Return the domain, bus and device IDs of the OpenCL device <code class="param">device</code>. </p>
228 <p>Device <code class="param">device</code> must match the local machine.</p>
229 <dl class="section return"><dt>Returns</dt><dd>0 on success. </dd>
230 <dd>
231 -1 on error, for instance if device information could not be found. </dd></dl>
232
233 </div>
234 </div>
235 </div><!-- contents -->
236 <!-- start footer part -->
237 <hr class="footer"/><address class="footer"><small>
238 Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0
239 </small></address>
240 </div><!-- doc-content -->
241 </body>
242 </html>