| 1 |
.TH "hwlocality_opencl" 3 "Version 2.14.0" "Hardware Locality (hwloc)" \" -*- nroff -*- |
| 2 |
.ad l |
| 3 |
.nh |
| 4 |
.SH NAME |
| 5 |
hwlocality_opencl \- Interoperability with OpenCL |
| 6 |
.SH SYNOPSIS |
| 7 |
.br |
| 8 |
.PP |
| 9 |
.SS "Functions" |
| 10 |
|
| 11 |
.in +1c |
| 12 |
.ti -1c |
| 13 |
.RI "int \fBhwloc_opencl_get_device_pci_busid\fP (cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)" |
| 14 |
.br |
| 15 |
.ti -1c |
| 16 |
.RI "int \fBhwloc_opencl_get_device_cpuset\fP (\fBhwloc_topology_t\fP topology, cl_device_id device, \fBhwloc_cpuset_t\fP set)" |
| 17 |
.br |
| 18 |
.ti -1c |
| 19 |
.RI "\fBhwloc_obj_t\fP \fBhwloc_opencl_get_device_osdev_by_index\fP (\fBhwloc_topology_t\fP topology, unsigned platform_index, unsigned device_index)" |
| 20 |
.br |
| 21 |
.ti -1c |
| 22 |
.RI "\fBhwloc_obj_t\fP \fBhwloc_opencl_get_device_osdev\fP (\fBhwloc_topology_t\fP topology, cl_device_id device)" |
| 23 |
.br |
| 24 |
.in -1c |
| 25 |
.SH "Detailed Description" |
| 26 |
.PP |
| 27 |
This interface offers ways to retrieve topology information about OpenCL devices\&. |
| 28 |
|
| 29 |
.PP |
| 30 |
Only AMD and NVIDIA OpenCL implementations currently offer useful locality information about their devices\&. |
| 31 |
.SH "Function Documentation" |
| 32 |
.PP |
| 33 |
.SS "int hwloc_opencl_get_device_cpuset (\fBhwloc_topology_t\fP topology, cl_device_id device, \fBhwloc_cpuset_t\fP set)\fR [inline]\fP" |
| 34 |
|
| 35 |
.PP |
| 36 |
Get the CPU set of processors that are physically close to OpenCL device \fRdevice\fP\&. Store in \fRset\fP the CPU-set describing the locality of the OpenCL device \fRdevice\fP\&. |
| 37 |
|
| 38 |
.PP |
| 39 |
Topology \fRtopology\fP and device \fRdevice\fP must match the local machine\&. I/O devices detection and the OpenCL component are not needed in the topology\&. |
| 40 |
|
| 41 |
.PP |
| 42 |
The function only returns the locality of the device\&. If more information about the device is needed, OS objects should be used instead, see \fBhwloc_opencl_get_device_osdev()\fP and \fBhwloc_opencl_get_device_osdev_by_index()\fP\&. |
| 43 |
|
| 44 |
.PP |
| 45 |
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\&. |
| 46 |
|
| 47 |
.PP |
| 48 |
\fBReturns\fP |
| 49 |
.RS 4 |
| 50 |
0 on success\&. |
| 51 |
|
| 52 |
.PP |
| 53 |
-1 on error, for instance if the device could not be found\&. |
| 54 |
.RE |
| 55 |
.PP |
| 56 |
|
| 57 |
.SS "\fBhwloc_obj_t\fP hwloc_opencl_get_device_osdev (\fBhwloc_topology_t\fP topology, cl_device_id device)\fR [inline]\fP" |
| 58 |
|
| 59 |
.PP |
| 60 |
Get the hwloc OS device object corresponding to OpenCL device \fRdeviceX\fP\&. |
| 61 |
.PP |
| 62 |
\fBReturns\fP |
| 63 |
.RS 4 |
| 64 |
The hwloc OS device object corresponding to the given OpenCL device \fRdevice\fP\&. |
| 65 |
|
| 66 |
.PP |
| 67 |
\fRNULL\fP if none could be found, for instance if required OpenCL attributes are not available\&. |
| 68 |
.RE |
| 69 |
.PP |
| 70 |
This function currently only works on AMD and NVIDIA OpenCL devices that support relevant OpenCL extensions\&. \fBhwloc_opencl_get_device_osdev_by_index()\fP should be preferred whenever possible, i\&.e\&. when platform and device index are known\&. |
| 71 |
|
| 72 |
.PP |
| 73 |
Topology \fRtopology\fP and device \fRdevice\fP 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 \fBhwloc_opencl_get_device_cpuset()\fP\&. |
| 74 |
|
| 75 |
.PP |
| 76 |
\fBNote\fP |
| 77 |
.RS 4 |
| 78 |
This function cannot work if PCI devices are filtered out\&. |
| 79 |
|
| 80 |
.PP |
| 81 |
The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out)\&. |
| 82 |
.RE |
| 83 |
.PP |
| 84 |
|
| 85 |
.SS "\fBhwloc_obj_t\fP hwloc_opencl_get_device_osdev_by_index (\fBhwloc_topology_t\fP topology, unsigned platform_index, unsigned device_index)\fR [inline]\fP" |
| 86 |
|
| 87 |
.PP |
| 88 |
Get the hwloc OS device object corresponding to the OpenCL device for the given indexes\&. |
| 89 |
.PP |
| 90 |
\fBReturns\fP |
| 91 |
.RS 4 |
| 92 |
The hwloc OS device object describing the OpenCL device whose platform index is \fRplatform_index\fP, and whose device index within this platform if \fRdevice_index\fP\&. |
| 93 |
|
| 94 |
.PP |
| 95 |
\fRNULL\fP if there is none\&. |
| 96 |
.RE |
| 97 |
.PP |
| 98 |
The topology \fRtopology\fP 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\&. |
| 99 |
|
| 100 |
.PP |
| 101 |
\fBNote\fP |
| 102 |
.RS 4 |
| 103 |
The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&. |
| 104 |
.RE |
| 105 |
.PP |
| 106 |
|
| 107 |
.SS "int hwloc_opencl_get_device_pci_busid (cl_device_id device, unsigned * domain, unsigned * bus, unsigned * dev, unsigned * func)\fR [inline]\fP" |
| 108 |
|
| 109 |
.PP |
| 110 |
Return the domain, bus and device IDs of the OpenCL device \fRdevice\fP\&. Device \fRdevice\fP must match the local machine\&. |
| 111 |
|
| 112 |
.PP |
| 113 |
\fBReturns\fP |
| 114 |
.RS 4 |
| 115 |
0 on success\&. |
| 116 |
|
| 117 |
.PP |
| 118 |
-1 on error, for instance if device information could not be found\&. |
| 119 |
.RE |
| 120 |
.PP |
| 121 |
|
| 122 |
.SH "Author" |
| 123 |
.PP |
| 124 |
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&. |