|
| 1 | +// Copyright 2018-2021 The Khronos Group. This work is licensed under a |
| 2 | +// Creative Commons Attribution 4.0 International License; see |
| 3 | +// http://creativecommons.org/licenses/by/4.0/ |
| 4 | + |
| 5 | +[[cl_khr_pci_bus_info]] |
| 6 | +== PCI Bus Information Query |
| 7 | + |
| 8 | +This extension adds a new query to obtain PCI bus information about an OpenCL |
| 9 | +device. |
| 10 | + |
| 11 | +Not all OpenCL devices have PCI bus information, either due to the device not |
| 12 | +being connected to the system through a PCI interface or due to platform |
| 13 | +specific restrictions and policies. Thus this extension is only expected to be |
| 14 | +supported by OpenCL devices which can provide the information. |
| 15 | + |
| 16 | +As a consequence, applications should always check for the presence of the |
| 17 | +extension string for each individual OpenCL device for which they intend to |
| 18 | +issue the new query for and should not have any assumptions about the |
| 19 | +availability of the extension on any given platform. |
| 20 | + |
| 21 | +=== General information |
| 22 | + |
| 23 | +==== Name Strings |
| 24 | + |
| 25 | +`cl_khr_pci_bus_info` |
| 26 | + |
| 27 | +==== Version History |
| 28 | + |
| 29 | +[cols="1,1,3",options="header",] |
| 30 | +|==== |
| 31 | +| *Date* | *Version* | *Description* |
| 32 | +| 2021-04-19 | 1.0.0 | Initial version. |
| 33 | +|==== |
| 34 | + |
| 35 | +==== Dependencies |
| 36 | + |
| 37 | +This extension is written against the OpenCL API Specification Version V3.0.6. |
| 38 | + |
| 39 | +This extension requires OpenCL 1.0. |
| 40 | + |
| 41 | +=== New API Types |
| 42 | + |
| 43 | +Structure returned by the device info query for `CL_DEVICE_PCI_BUS_INFO_KHR`: |
| 44 | + |
| 45 | +[source,c] |
| 46 | +---- |
| 47 | +typedef struct _cl_device_pci_bus_info_khr { |
| 48 | + cl_uint pci_domain; |
| 49 | + cl_uint pci_bus; |
| 50 | + cl_uint pci_device; |
| 51 | + cl_uint pci_function; |
| 52 | +} cl_device_pci_bus_info_khr; |
| 53 | +---- |
| 54 | + |
| 55 | +=== New API Enums |
| 56 | + |
| 57 | +Accepted value for the _param_name_ parameter to *clGetDeviceInfo*: |
| 58 | + |
| 59 | +[source,c] |
| 60 | +---- |
| 61 | +#define CL_DEVICE_PCI_BUS_INFO_KHR 0x410F |
| 62 | +---- |
| 63 | + |
| 64 | +=== Modifications to the OpenCL API Specification |
| 65 | + |
| 66 | +==== Section 4.2 - Querying Devices: |
| 67 | + |
| 68 | +Add to Table 5 - OpenCL Device Queries: |
| 69 | + |
| 70 | +[caption="Table 5. "] |
| 71 | +.OpenCL Device Queries |
| 72 | +[width="100%",cols="<30%,<20%,<50%",options="header"] |
| 73 | +|==== |
| 74 | +| *cl_device_info* | Return Type | Description |
| 75 | +| `CL_DEVICE_PCI_BUS_INFO_KHR` |
| 76 | + | `cl_device_pci_bus_info_khr` |
| 77 | + | Returns PCI bus information for the device. |
| 78 | + |
| 79 | + The PCI bus information is returned as a single structure that includes |
| 80 | + the PCI bus domain, the PCI bus identifier, the PCI device identifier, and |
| 81 | + the PCI device function identifier. |
| 82 | + |
| 83 | +|==== |
0 commit comments