Skip to content

Commit 504ac97

Browse files
author
psamolysov-intel
authored
[SYCL] Define missing feature test macros (#4792)
According to SYCL spec (6.3.3. Feature test macros), vendors are encouraged to group a related set of extensions together into a "feature" and to predefine a feature-test macro when the implementation supports the extensions in that feature. The feature-test macro should have the following form to ensure it is unique: SYCL_EXT_<vendorstring>_<featurename>. The patch defines the following feature test macros: - SYCL_EXT_ONEAPI_ASSERT (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/Assert/SYCL_ONEAPI_ASSERT.asciidoc) - SYCL_EXT_ONEAPI_FREE_FUNCTION_QUERIES (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/FreeFunctionQueries/SYCL_INTEL_free_function_queries.asciidoc) - SYCL_EXT_ONEAPI_GROUP_ALGORITHMS (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc) - SYCL_EXT_ONEAPI_GROUP_SORT (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_sort.asciidoc) - SYCL_EXT_ONEAPI_LOCAL_MEMORY (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/LocalMemory/LocalMemory.asciidoc) - SYCL_EXT_ONEAPI_ND_RANGE_REDUCTIONS (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/Reduction/Reduction.md) - SYCL_EXT_ONEAPI_DEFAULT_CONTEXT (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/PlatformContext/PlatformContext.adoc) - SYCL_EXT_ONEAPI_USE_PINNED_HOST_MEMORY_PROPERTY (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/UsePinnedMemoryProperty/UsePinnedMemoryPropery.adoc) - SYCL_EXT_ONEAPI_SUB_GROUP (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/SubGroup/SYCL_INTEL_sub_group.asciidoc) - SYCL_EXT_INTEL_BITCAST (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/Bitcast/SYCL_INTEL_bitcast.asciidoc) - SYCL_EXT_INTEL_DATAFLOW_PIPES (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/DataFlowPipes/data_flow_pipes.asciidoc) - SYCL_EXT_INTEL_EXTENDED_ATOMICS (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/ExtendedAtomics/SYCL_INTEL_extended_atomics.asciidoc) - SYCL_EXT_INTEL_FPGA_DEVICE_SELECTOR (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/IntelFPGA/FPGASelector.md) - SYCL_EXT_INTEL_FPGA_LSU (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/IntelFPGA/FPGALsu.md) - SYCL_EXT_INTEL_FPGA_REG (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/IntelFPGA/FPGAReg.md) - SYCL_EXT_INTEL_KERNEL_ARGS_RESTRICT (for https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/KernelRestrictAll/SYCL_INTEL_kernel_restrict_all.asciidoc) The feature macros are defined for documented extensions only.
1 parent c623223 commit 504ac97

File tree

16 files changed

+211
-11
lines changed

16 files changed

+211
-11
lines changed

sycl/doc/extensions/Bitcast/SYCL_INTEL_bitcast.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,22 @@ namespace sycl {
104104

105105
None.
106106

107+
== Feature test macro
108+
109+
This extension provides a feature-test macro as described in the core SYCL
110+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
111+
supporting this extension must predefine the macro `SYCL_EXT_INTEL_BITCAST` to
112+
one of the values defined in the table below. Applications can test for the
113+
existence of this macro to determine if the implementation supports this
114+
feature, or applications can test the macro's value to determine which of the
115+
extension's APIs the implementation supports.
116+
117+
[%header,cols="1,5"]
118+
|===
119+
|Value |Description
120+
|1 |Initial extension version. Base features are supported.
121+
|===
122+
107123
== Revision History
108124

109125
[cols="5,15,15,70"]

sycl/doc/extensions/DataFlowPipes/data_flow_pipes.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,22 @@ Automated mechanisms are possible to provide uniquification across calls, and co
634634
*RESOLUTION*: Resolved. Abstraction/libraries on top enable functionality like this. We will make public a library that enables arrays of pipes.
635635
--
636636

637+
== Feature test macro
638+
639+
This extension provides a feature-test macro as described in the core SYCL
640+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
641+
supporting this extension must predefine the macro `SYCL_EXT_INTEL_DATAFLOW_PIPES`
642+
to one of the values defined in the table below. Applications can test for the
643+
existence of this macro to determine if the implementation supports this
644+
feature, or applications can test the macro's value to determine which of the
645+
extension's APIs the implementation supports.
646+
647+
[%header,cols="1,5"]
648+
|===
649+
|Value |Description
650+
|1 |Initial extension version. Base features are supported.
651+
|===
652+
637653
== Revision History
638654

639655
[cols="5,15,15,70"]

sycl/doc/extensions/ExtendedAtomics/SYCL_INTEL_extended_atomics.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,22 @@ None.
647647
//*RESOLUTION*: Not resolved.
648648
//--
649649
650+
== Feature test macro
651+
652+
This extension provides a feature-test macro as described in the core SYCL
653+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
654+
supporting this extension must predefine the macro `SYCL_EXT_INTEL_EXTENDED_ATOMICS`
655+
to one of the values defined in the table below. Applications can test for the
656+
existence of this macro to determine if the implementation supports this
657+
feature, or applications can test the macro's value to determine which of the
658+
extension's APIs the implementation supports.
659+
660+
[%header,cols="1,5"]
661+
|===
662+
|Value |Description
663+
|1 |Initial extension version. Base features are supported.
664+
|===
665+
650666
== Revision History
651667
652668
[cols="5,15,15,70"]

sycl/doc/extensions/FreeFunctionQueries/SYCL_INTEL_free_function_queries.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,19 @@ Returns the `sub_group` instance representing the particular `sub-group` within
208208
209209
If prerequisites are not fulfilled the behavior is undefined
210210
|===
211+
212+
== Feature test macro
213+
214+
This extension provides a feature-test macro as described in the core SYCL
215+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
216+
supporting this extension must predefine the macro `SYCL_EXT_ONEAPI_FREE_FUNCTION_QUERIES`
217+
to one of the values defined in the table below. Applications can test for the
218+
existence of this macro to determine if the implementation supports this
219+
feature, or applications can test the macro's value to determine which of the
220+
extension's APIs the implementation supports.
221+
222+
[%header,cols="1,5"]
223+
|===
224+
|Value |Description
225+
|1 |Initial extension version. Base features are supported.
226+
|===

sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,22 @@ None.
267267
*RESOLUTION*: The `is_native_function_object` trait has been removed. It proved too difficult to implement something that returned sensible values for transparent function objects (e.g. `std::plus<void>`) that did not also require checking additional traits for each individual group algorithm. Requiring the user to implement their own checks based on type requirements outlined in the specification would make it significantly harder for implementers to extend the algorithms to types and function objects beyond what is specified. Using constrained forms of the algorithms instead allows a user to determine whether an implementation of a particular algorithm exists using the C++ detection idiom.
268268
--
269269
270+
== Feature test macro
271+
272+
This extension provides a feature-test macro as described in the core SYCL
273+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
274+
supporting this extension must predefine the macro `SYCL_EXT_ONEAPI_GROUP_ALGORITHMS`
275+
to one of the values defined in the table below. Applications can test for the
276+
existence of this macro to determine if the implementation supports this
277+
feature, or applications can test the macro's value to determine which of the
278+
extension's APIs the implementation supports.
279+
280+
[%header,cols="1,5"]
281+
|===
282+
|Value |Description
283+
|1 |Initial extension version. Base features are supported.
284+
|===
285+
270286
== Revision History
271287
272288
[cols="5,15,15,70"]

sycl/doc/extensions/IntelFPGA/FPGALsu.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,17 @@ Queue.submit([&](cl::sycl::handler &cgh) {
118118
});
119119
...
120120
```
121+
122+
## Feature Test Macro
123+
124+
This extension provides a feature-test macro as described in the core SYCL
125+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
126+
supporting this extension must predefine the macro `SYCL_EXT_INTEL_FPGA_LSU`
127+
to one of the values defined in the table below. Applications can test for the
128+
existence of this macro to determine if the implementation supports this
129+
feature, or applications can test the macro’s value to determine which of the
130+
extension’s APIs the implementation supports.
131+
132+
|Value |Description|
133+
|:---- |:---------:|
134+
|1 |Initial extension version. Base features are supported.|

sycl/doc/extensions/IntelFPGA/FPGAReg.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,17 @@ int a = cl::sycl::intel::fpga_reg(a[k]) + b[k];
2929

3030
...
3131
```
32+
33+
## Feature Test Macro
34+
35+
This extension provides a feature-test macro as described in the core SYCL
36+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
37+
supporting this extension must predefine the macro `SYCL_EXT_INTEL_FPGA_REG`
38+
to one of the values defined in the table below. Applications can test for the
39+
existence of this macro to determine if the implementation supports this
40+
feature, or applications can test the macro’s value to determine which of the
41+
extension’s APIs the implementation supports.
42+
43+
|Value |Description|
44+
|:---- |:---------:|
45+
|1 |Initial extension version. Base features are supported.|

sycl/doc/extensions/IntelFPGA/FPGASelector.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,17 @@ cl::sycl::queue deviceQueue{cl::sycl::ext::intel::fpga_selector{}};
2525
cl::sycl::queue deviceQueue{cl::sycl::ext::intel::fpga_emulator_selector{}};
2626
...
2727
```
28+
29+
## Feature Test Macro
30+
31+
This extension provides a feature-test macro as described in the core SYCL
32+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
33+
supporting this extension must predefine the macro `SYCL_EXT_INTEL_FPGA_DEVICE_SELECTOR`
34+
to one of the values defined in the table below. Applications can test for the
35+
existence of this macro to determine if the implementation supports this
36+
feature, or applications can test the macro’s value to determine which of the
37+
extension’s APIs the implementation supports.
38+
39+
|Value |Description|
40+
|:---- |:---------:|
41+
|1 |Initial extension version. Base features are supported.|

sycl/doc/extensions/KernelRestrictAll/SYCL_INTEL_kernel_restrict_all.asciidoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,21 @@ None.
109109
//*RESOLUTION*: Description
110110
//--
111111
112-
112+
== Feature test macro
113+
114+
This extension provides a feature-test macro as described in the core SYCL
115+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
116+
supporting this extension must predefine the macro `SYCL_EXT_INTEL_KERNEL_ARGS_RESTRICT`
117+
to one of the values defined in the table below. Applications can test for the
118+
existence of this macro to determine if the implementation supports this
119+
feature, or applications can test the macro’s value to determine which of the
120+
extension’s APIs the implementation supports.
121+
122+
[%header,cols="1,5"]
123+
|===
124+
|Value |Description
125+
|1 |Initial extension version. Base features are supported.
126+
|===
113127
114128
== Revision History
115129

sycl/doc/extensions/Reduction/Reduction.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,17 @@ __kernel void dot_product(__global float* a, __global float* b, __global float*
186186
atomic_add(sum, a[i] * b[i]);
187187
}
188188
```
189+
190+
## Feature Test Macro
191+
192+
This extension provides a feature-test macro as described in the core SYCL
193+
specification section 6.3.3 "Feature test macros". Therefore, an implementation
194+
supporting this extension must predefine the macro `SYCL_EXT_ONEAPI_ND_RANGE_REDUCTIONS`
195+
to one of the values defined in the table below. Applications can test for the
196+
existence of this macro to determine if the implementation supports this
197+
feature, or applications can test the macro's value to determine which of the
198+
extension's APIs the implementation supports.
199+
200+
|Value |Description|
201+
|:---- |:---------:|
202+
|1 |Initial extension version. Base features are supported.|

0 commit comments

Comments
 (0)