Skip to content

Commit

Permalink
updated after March 26th teleconference
Browse files Browse the repository at this point in the history
Clarified that this is a provisional extension
Removed ext from feature names and feature test macros
Added undefined behavior description to the SPIR-V environment spec
  • Loading branch information
bashbaug committed Mar 26, 2024
1 parent e922ca7 commit 5612968
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
12 changes: 6 additions & 6 deletions OpenCL_C.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ products on 4x8 bit integer vectors.
endif::cl_khr_integer_dot_product[]

ifdef::cl_khr_kernel_clock[]
| {opencl_c_ext_kernel_clock_scope_device}
| {opencl_c_kernel_clock_scope_device}
| The OpenCL C compiler supports built-in functions that sample the value from a
clock shared by all work-items executing on the device.

| {opencl_c_ext_kernel_clock_scope_work_group}
| {opencl_c_kernel_clock_scope_work_group}
| The OpenCL C compiler supports built-in functions that sample the value from a
clock shared by all work-items executing in the same work-group.

| {opencl_c_ext_kernel_clock_scope_sub_group}
| {opencl_c_kernel_clock_scope_sub_group}
| The OpenCL C compiler supports built-in functions that sample the value from a
clock shared by all work-items executing in the same sub-group.
endif::cl_khr_kernel_clock[]
Expand Down Expand Up @@ -15251,11 +15251,11 @@ ifdef::cl_khr_kernel_clock[]
NOTE: The functionality described in this section <<unified-spec, requires>>
support for the `<<cl_khr_kernel_clock>>` extension. +
The `clock_read_device` and `clock_read_hilo_device` functions require support
for the {opencl_c_ext_kernel_clock_scope_device} feature.
for the {opencl_c_kernel_clock_scope_device} feature.
The `clock_read_work_group` and `clock_read_hilo_work_group` functions require
support for the {opencl_c_ext_kernel_clock_scope_work_group} feature.
support for the {opencl_c_kernel_clock_scope_work_group} feature.
The `clock_read_sub_group` and `clock_read_hilo_sub_group` functions require
support for the {opencl_c_ext_kernel_clock_scope_sub_group} feature.
support for the {opencl_c_kernel_clock_scope_sub_group} feature.

This section describes OpenCL C built-in functions that sample the value from
one of three clocks provided by compute units.
Expand Down
6 changes: 3 additions & 3 deletions api/opencl_platform_layer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2103,11 +2103,11 @@ returned for {CL_DEVICE_KERNEL_CLOCK_CAPABILITIES_KHR}:
|====
| Feature Bit | Feature Macro
| {CL_DEVICE_KERNEL_CLOCK_SCOPE_DEVICE_KHR}
| {opencl_c_ext_kernel_clock_scope_device}
| {opencl_c_kernel_clock_scope_device}
| {CL_DEVICE_KERNEL_CLOCK_SCOPE_WORK_GROUP_KHR}
| {opencl_c_ext_kernel_clock_scope_work_group}
| {opencl_c_kernel_clock_scope_work_group}
| {CL_DEVICE_KERNEL_CLOCK_SCOPE_SUB_GROUP_KHR}
| {opencl_c_ext_kernel_clock_scope_sub_group}
| {opencl_c_kernel_clock_scope_sub_group}
|====
endif::cl_khr_kernel_clock[]

Expand Down
18 changes: 9 additions & 9 deletions c/feature-dictionary.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,26 @@ ifndef::backend-html5[]
:opencl_c_integer_dot_product_input_4x8bit_packed: pass:q[`\__opencl_c_&#8203;integer_&#8203;dot_&#8203;product_&#8203;input_&#8203;4x8bit_&#8203;packed`]
endif::[]

// opencl_c_ext_kernel_clock_scope_device
// opencl_c_kernel_clock_scope_device
ifdef::backend-html5[]
:opencl_c_ext_kernel_clock_scope_device: pass:q[`\__opencl_c_<wbr>ext_<wbr>kernel_<wbr>clock_<wbr>scope_<wbr>device`]
:opencl_c_kernel_clock_scope_device: pass:q[`\__opencl_c_<wbr>kernel_<wbr>clock_<wbr>scope_<wbr>device`]
endif::[]
ifndef::backend-html5[]
:opencl_c_ext_kernel_clock_scope_device: pass:q[`\__opencl_c_&#8203;ext_&#8203;kernel_&#8203;clock_&#8203;scope_&#8203;device`]
:opencl_c_kernel_clock_scope_device: pass:q[`\__opencl_c_&#8203;kernel_&#8203;clock_&#8203;scope_&#8203;device`]
endif::[]

// opencl_c_ext_kernel_clock_scope_work_group
// opencl_c_kernel_clock_scope_work_group
ifdef::backend-html5[]
:opencl_c_ext_kernel_clock_scope_work_group: pass:q[`\__opencl_c_<wbr>ext_<wbr>kernel_<wbr>clock_<wbr>scope_<wbr>work_<wbr>group`]
:opencl_c_kernel_clock_scope_work_group: pass:q[`\__opencl_c_<wbr>kernel_<wbr>clock_<wbr>scope_<wbr>work_<wbr>group`]
endif::[]
ifndef::backend-html5[]
:opencl_c_ext_kernel_clock_scope_work_group: pass:q[`\__opencl_c_&#8203;ext_&#8203;kernel_&#8203;clock_&#8203;scope_&#8203;work_&#8203;group`]
:opencl_c_kernel_clock_scope_work_group: pass:q[`\__opencl_c_&#8203;kernel_&#8203;clock_&#8203;scope_&#8203;work_&#8203;group`]
endif::[]

// opencl_c_ext_kernel_clock_scope_sub_group
// opencl_c_kernel_clock_scope_sub_group
ifdef::backend-html5[]
:opencl_c_ext_kernel_clock_scope_sub_group: pass:q[`\__opencl_c_<wbr>ext_<wbr>kernel_<wbr>clock_<wbr>scope_<wbr>sub_<wbr>group`]
:opencl_c_kernel_clock_scope_sub_group: pass:q[`\__opencl_c_<wbr>kernel_<wbr>clock_<wbr>scope_<wbr>sub_<wbr>group`]
endif::[]
ifndef::backend-html5[]
:opencl_c_ext_kernel_clock_scope_sub_group: pass:q[`\__opencl_c_&#8203;ext_&#8203;kernel_&#8203;clock_&#8203;scope_&#8203;sub_&#8203;group`]
:opencl_c_kernel_clock_scope_sub_group: pass:q[`\__opencl_c_&#8203;kernel_&#8203;clock_&#8203;scope_&#8203;sub_&#8203;group`]
endif::[]
10 changes: 8 additions & 2 deletions env/extensions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,17 @@ Otherwise, for the *GroupUniformArithmeticKHR* scan and reduction instructions,

If the OpenCL environment supports the extension `cl_khr_kernel_clock`, then the environment must accept modules that declare use of the extension `SPV_KHR_shader_clock` via *OpExtension*.

If the OpenCL environment supports the extension `cl_khr_kernel_clock` and use of the SPIR-V extension `SPV_KHR_shader_clock` is declared in the module via *OpExtension*, then the environment must accept modules that declare the following SPIR-V capabilities:
If the OpenCL environment supports the extension `cl_khr_kernel_clock` and use of the SPIR-V extension `SPV_KHR_shader_clock` is declared in the module via *OpExtension*, then the environment must accept modules that declare the following SPIR-V capability:

* *ShaderClockKHR*

// TODO: describe when each Scope is valid for instructions requiring these capabilities?
For the *OpReadClockKHR* instruction requiring this capability, supported values for _Scope_ are:

* *Device*, if `CL_DEVICE_KERNEL_CLOCK_SCOPE_DEVICE_KHR` is supported
* *Workgroup*, if `CL_DEVICE_KERNEL_CLOCK_SCOPE_WORK_GROUP_KHR` is supported
* *Subgroup*, if `CL_DEVICE_KERNEL_CLOCK_SCOPE_SUB_GROUP_KHR` is supported

For unsupported _Scope_ values, the behavior of *OpReadClockKHR* is undefined.

=== Embedded Profile Extensions

Expand Down
2 changes: 1 addition & 1 deletion xml/cl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7459,7 +7459,7 @@ server's OpenCL/api-docs repository.
<command name="clCancelCommandsIMG"/>
</require>
</extension>
<extension name="cl_khr_kernel_clock" supported="opencl" ratified="opencl">
<extension name="cl_khr_kernel_clock" supported="opencl" ratified="opencl" provisional="true">
<require>
<type name="CL/cl.h"/>
</require>
Expand Down

0 comments on commit 5612968

Please sign in to comment.