hwlocality_opencl.3 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. .TH "hwlocality_opencl" 3 "Thu Sep 7 2023" "Version 2.9.3" "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. .in +1c
  11. .ti -1c
  12. .RI "static int \fBhwloc_opencl_get_device_pci_busid\fP (cl_device_id device, unsigned *domain, unsigned *bus, unsigned *dev, unsigned *func)"
  13. .br
  14. .ti -1c
  15. .RI "static int \fBhwloc_opencl_get_device_cpuset\fP (\fBhwloc_topology_t\fP topology, cl_device_id device, \fBhwloc_cpuset_t\fP set)"
  16. .br
  17. .ti -1c
  18. .RI "static \fBhwloc_obj_t\fP \fBhwloc_opencl_get_device_osdev_by_index\fP (\fBhwloc_topology_t\fP topology, unsigned platform_index, unsigned device_index)"
  19. .br
  20. .ti -1c
  21. .RI "static \fBhwloc_obj_t\fP \fBhwloc_opencl_get_device_osdev\fP (\fBhwloc_topology_t\fP topology, cl_device_id device)"
  22. .br
  23. .in -1c
  24. .SH "Detailed Description"
  25. .PP
  26. This interface offers ways to retrieve topology information about OpenCL devices\&.
  27. .PP
  28. Only AMD and NVIDIA OpenCL implementations currently offer useful locality information about their devices\&.
  29. .SH "Function Documentation"
  30. .PP
  31. .SS "static int hwloc_opencl_get_device_cpuset (\fBhwloc_topology_t\fP topology, cl_device_id device, \fBhwloc_cpuset_t\fP set)\fC [inline]\fP, \fC [static]\fP"
  32. .PP
  33. Get the CPU set of processors that are physically close to OpenCL device \fCdevice\fP\&. Store in \fCset\fP the CPU-set describing the locality of the OpenCL device \fCdevice\fP\&.
  34. .PP
  35. Topology \fCtopology\fP and device \fCdevice\fP must match the local machine\&. I/O devices detection and the OpenCL component are not needed in the topology\&.
  36. .PP
  37. 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\&.
  38. .PP
  39. This function is currently only implemented in a meaningful way for Linux with the AMD or NVIDIA OpenCL implementation; other systems will simply get a full cpuset\&.
  40. .PP
  41. \fBReturns\fP
  42. .RS 4
  43. 0 on success\&.
  44. .PP
  45. -1 on error, for instance if the device could not be found\&.
  46. .RE
  47. .PP
  48. .SS "static \fBhwloc_obj_t\fP hwloc_opencl_get_device_osdev (\fBhwloc_topology_t\fP topology, cl_device_id device)\fC [inline]\fP, \fC [static]\fP"
  49. .PP
  50. Get the hwloc OS device object corresponding to OpenCL device \fCdeviceX\fP\&.
  51. .PP
  52. \fBReturns\fP
  53. .RS 4
  54. The hwloc OS device object corresponding to the given OpenCL device \fCdevice\fP\&.
  55. .PP
  56. \fCNULL\fP if none could be found, for instance if required OpenCL attributes are not available\&.
  57. .RE
  58. .PP
  59. 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\&.
  60. .PP
  61. Topology \fCtopology\fP and device \fCdevice\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\&.
  62. .PP
  63. \fBNote\fP
  64. .RS 4
  65. This function cannot work if PCI devices are filtered out\&.
  66. .PP
  67. The corresponding hwloc PCI device may be found by looking at the result parent pointer (unless PCI devices are filtered out)\&.
  68. .RE
  69. .PP
  70. .SS "static \fBhwloc_obj_t\fP hwloc_opencl_get_device_osdev_by_index (\fBhwloc_topology_t\fP topology, unsigned platform_index, unsigned device_index)\fC [inline]\fP, \fC [static]\fP"
  71. .PP
  72. Get the hwloc OS device object corresponding to the OpenCL device for the given indexes\&.
  73. .PP
  74. \fBReturns\fP
  75. .RS 4
  76. The hwloc OS device object describing the OpenCL device whose platform index is \fCplatform_index\fP, and whose device index within this platform if \fCdevice_index\fP\&.
  77. .PP
  78. \fCNULL\fP if there is none\&.
  79. .RE
  80. .PP
  81. The topology \fCtopology\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\&.
  82. .PP
  83. \fBNote\fP
  84. .RS 4
  85. The corresponding PCI device object can be obtained by looking at the OS device parent object (unless PCI devices are filtered out)\&.
  86. .RE
  87. .PP
  88. .SS "static int hwloc_opencl_get_device_pci_busid (cl_device_id device, unsigned * domain, unsigned * bus, unsigned * dev, unsigned * func)\fC [inline]\fP, \fC [static]\fP"
  89. .PP
  90. Return the domain, bus and device IDs of the OpenCL device \fCdevice\fP\&. Device \fCdevice\fP must match the local machine\&.
  91. .PP
  92. \fBReturns\fP
  93. .RS 4
  94. 0 on success\&.
  95. .PP
  96. -1 on error, for instance if device information could not be found\&.
  97. .RE
  98. .PP
  99. .SH "Author"
  100. .PP
  101. Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&.