@@ -7,9 +7,7 @@ traits `any_device_has` and `all_devices_have` as described in the
7
7
In summary, ` any_device_has<aspect> ` and ` all_devices_have<aspect> ` must inherit
8
8
from either ` std::true_t ` or ` std::false_t ` depending on whether the
9
9
corresponding compilation environment can guarantee that any and all the
10
- supported devices support the ` aspect ` . Since DPC++ allows for compiling for
11
- multiple targets, these traits can be different when compiling for the
12
- individual targets and on host.
10
+ supported devices support the ` aspect ` .
13
11
14
12
The design of these traits is inspired by the implementation of the
15
13
[ sycl\_ ext\_ oneapi\_ device\_ if] [ 2 ] and
@@ -28,22 +26,35 @@ specified in the device headers rather than by the names specified in the
28
26
29
27
For each target $t$ in ` -fsycl-targets ` , let $A^{any}_ t$ be the set of aspects
30
28
supported by any device supporting $t$ and let $A^{all}_ t$ be the set of aspects
31
- supported by all devices supporting $t$. If $t$ has an entry in the
32
- configuration file, these sets are defined by the ` aspects ` list in that entry
33
- and $A^{any} _ t = A^{all} _ t$. If there is no entry for $t$ in the configuration
34
- file, then $A^{any} _ t$ is the set of all aspects and $A^{all}_ t = \emptyset$ .
35
-
36
- In the device-side compilation of a SYCL program for $t$ the driver defines the
37
- following macros:
38
- * ` __SYCL_ALL_DEVICES_HAVE_ ` $i$ ` __ ` as ` 1 ` for all $i$ in $A^{all} _ t$.
39
- * ` __SYCL_ANY_DEVICE_HAS_ANY_ASPECT__ ` as ` 1 ` if $A^{any}_ t$ is the set of all
29
+ supported by all devices supporting $t$. These sets are defined as follows:
30
+ * If $t$ has an entry in the configuration file, $A^{all} _ t$ is the same as the
31
+ ` aspects ` list in that entry.
32
+ * If $t$ does not have an entry in the configuration file, $A^{all}_ t$ is empty .
33
+ * If $t$ has an entry in the configuration file and the entry has a value
34
+ ` may_support_other_aspects ` set to ` false ` , $A^{any} _ t$ is the same as the
35
+ ` aspects ` list in that entry.
36
+ * If $t$ does not have an entry the configuration file or the entry has a value
37
+ ` may_support_other_aspects ` set to ` true ` , $A^{any}_ t$ is the set of all
40
38
aspects.
41
- * ` __SYCL_ANY_DEVICE_HAS_ ` $j$` __ ` as ` 1 ` for all $j$ in $A^{any}_ t$ if
42
- ` __SYCL_ANY_DEVICE_HAS_ANY_ASPECT__ ` was not defined.
43
39
44
- In the host-side compilation of a SYCL program, where $[ t1, t2, \ldots, tn] $ are
45
- the $n$ targets specified in ` -fsycl-targets ` , the driver defines the following
46
- macros:
40
+ For example, the target ` intel_gpu_dg1 ` is supported by a specific device (DG1)
41
+ and as such would have an entry in the configuration file with ` aspects ` being
42
+ the set of aspects that device supports. Likewise it would have
43
+ ` may_support_other_aspects ` set to ` false ` as there will be no other devices
44
+ supporting this target, meaning there will never be any devices supporting
45
+ the target and supporting anything not in ` aspects ` . In contrast, the target
46
+ ` nvidia_gpu_sm_80 ` is supported by CUDA devices with ` sm_80 ` architecture or
47
+ newer, so its entry in the configuration file would have
48
+ ` may_support_other_aspects ` set to ` true ` to indicate that there could be future
49
+ devices that support aspects not in ` aspects ` , while it is known that all
50
+ current and future devices must support the aspects in ` aspects ` . Lastly, the
51
+ default JIT SPIR-V target (` spir64 ` ) should not have an entry in the
52
+ configuration file as it cannot guarantee anything about the devices supporting
53
+ the target.
54
+
55
+ When compiling a SYCL program, where $[ t1, t2, \ldots, tn] $ are the $n$ targets
56
+ specified in ` -fsycl-targets ` including any targets implicitly added by the
57
+ driver, the driver defines the following macros:
47
58
* ` __SYCL_ALL_DEVICES_HAVE_ ` $i$` __ ` as ` 1 ` for all $i$ in
48
59
${\bigcap}^n_ {k=1} A^{all}_ {tk}$.
49
60
* ` __SYCL_ANY_DEVICE_HAS_ANY_ASPECT__ ` as ` 1 ` if
0 commit comments