Skip to content

Commit ddb23a1

Browse files
authored
cl_khr_spirv_extended_debug_info, cl_khr_spirv_linkonce_odr, cl_khr_pci_bus_info (#599)
* cl_khr_spirv_extended_debug_info * cl_khr_spirv_linkonce_odr * cl_khr_pci_bus_info * address review comments
1 parent 8798901 commit ddb23a1

6 files changed

Lines changed: 120 additions & 1 deletion

File tree

OpenCL_Ext.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ include::ext/cl_khr_extended_versioning.asciidoc[]
8484

8585
include::ext/cl_khr_subgroup_extensions.asciidoc[]
8686

87+
include::ext/cl_khr_pci_bus_info.asciidoc[]
88+
8789
// NOTE: To keep meaningful section numbers, new
8890
// extension documents should be added above here!
8991

env/extensions.asciidoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,17 @@ For instructions requiring these capabilities, _Scope_ for _Execution_ may be:
313313

314314
When the *GroupNonUniformClustered* capability is declared, the *GroupNonUniformArithmetic* scan and reduction instructions may include the optional _ClusterSize_ operand.
315315

316+
==== `cl_khr_spirv_extended_debug_info`
317+
318+
If the OpenCL environment supports the extension `cl_khr_spirv_extended_debug_info`, then the environment must accept modules
319+
that import the `OpenCL.DebugInfo.100` extended instruction set via *OpExtInstImport*.
320+
321+
==== `cl_khr_spirv_linkonce_odr`
322+
323+
If the OpenCL environment supports the extension `cl_khr_spirv_linkonce_odr`, then the environment must accept modules that declare use of the extension `SPV_KHR_linkonce_odr` via *OpExtension*.
324+
325+
If the OpenCL environment supports the extension `cl_khr_spirv_linkonce_odr` and use of the SPIR-V extension `SPV_KHR_linkonce_odr` is declared in the module via *OpExtension*, then the environment must accept modules that include the *LinkOnceODR* linkage type.
326+
316327
=== Embedded Profile Extensions
317328

318329
==== `cles_khr_int64`

ext/cl_khr_pci_bus_info.asciidoc

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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+
|====

ext/quick_reference.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@
141141
| Write to Images with Mipmaps
142142
| Extension
143143

144+
| <<cl_khr_pci_bus_info,cl_khr_pci_bus_info>>
145+
| Query PCI Bus Information for an OpenCL Device
146+
| Extension
147+
144148
| <<cl_khr_priority_hints,cl_khr_priority_hints>>
145149
| Create Command Queues with Different Priorities
146150
| Extension

ext/spirv_extensions.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ Please refer to the OpenCL SPIR-V Environment Specification for descriptions how
1010
In addition to the extensions described in this document, the OpenCL SPIR-V Environment Specification also describes how the following OpenCL extensions modify an OpenCL SPIR-V environment:
1111

1212
* `cl_khr_spirv_no_integer_wrap_decoration`
13+
* `cl_khr_spirv_extended_debug_info`
14+
* `cl_khr_spirv_linkonce_odr`

xml/cl.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ server's OpenCL/api-docs repository.
277277
<member><type>cl_version_khr</type> <name>version</name></member>
278278
<member><type>char</type><name>name</name>[<enum>CL_NAME_VERSION_MAX_NAME_SIZE_KHR</enum>]</member>
279279
</type>
280+
<type category="struct" name="cl_device_pci_bus_info_khr">
281+
<member><type>cl_uint</type> <name>pci_domain</name></member>
282+
<member><type>cl_uint</type> <name>pci_bus</name></member>
283+
<member><type>cl_uint</type> <name>pci_device</name></member>
284+
<member><type>cl_uint</type> <name>pci_function</name></member>
285+
</type>
280286
<type category="struct" name="cl_queue_family_properties_intel">
281287
<member><type>cl_command_queue_properties</type> <name>properties</name></member>
282288
<member><type>cl_command_queue_capabilities_intel</type> <name>capabilities</name></member>
@@ -1837,7 +1843,7 @@ server's OpenCL/api-docs repository.
18371843
<enum value="0x410C" name="CL_DEVICE_AVC_ME_SUPPORTS_TEXTURE_SAMPLER_USE_INTEL"/>
18381844
<enum value="0x410D" name="CL_DEVICE_AVC_ME_SUPPORTS_PREEMPTION_INTEL"/>
18391845
<enum value="0x410E" name="CL_NV12_INTEL"/>
1840-
<unused start="0x410F"/>
1846+
<enum value="0x410F" name="CL_DEVICE_PCI_BUS_INFO_KHR"/>
18411847
</enums>
18421848

18431849
<enums start="0x4110" end="0x411F" name="enums.4110" vendor="Qualcomm" comment="Per Bug 13929">
@@ -6066,5 +6072,16 @@ server's OpenCL/api-docs repository.
60666072
<enum name="CL_QUEUE_CAPABILITY_KERNEL_INTEL"/>
60676073
</require>
60686074
</extension>
6075+
<extension name="cl_khr_pci_bus_info" supported="opencl">
6076+
<require>
6077+
<type name="CL/cl.h"/>
6078+
</require>
6079+
<require>
6080+
<type name="cl_device_pci_bus_info_khr"/>
6081+
</require>
6082+
<require comment="cl_device_info">
6083+
<enum name="CL_DEVICE_PCI_BUS_INFO_KHR"/>
6084+
</require>
6085+
</extension>
60696086
</extensions>
60706087
</registry>

0 commit comments

Comments
 (0)