Skip to content

Commit 27cc930

Browse files
authored
[SYCL][DOC] Clarify "[[uses_aspects()]]" in design (#5594)
Clarify the design doc to note that the C++ attribute `[[sycl_detail::uses_aspects()]]` is only needed for the device compiler and should be protected via `#ifdef`.
1 parent 2f5e990 commit 27cc930

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sycl/doc/design/OptionalDeviceFeatures.md

+5
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ instantiations of `sycl::atomic_ref` as an optional feature.
369369

370370
[6]: <#appendix-adding-an-attribute-to-8-byte-atomic_ref>
371371

372+
Because the `[[sycl_detail::uses_aspects()]]` attribute is only needed for the
373+
device compiler, the headers should protect it with
374+
`#ifdef __SYCL_DEVICE_ONLY__`. This avoids warnings when our headers are
375+
compiled with a third-party host compiler.
376+
372377
Although the examples above show only a single aspect parameter to the
373378
`[[sycl_detail::uses_aspects()]]` attribute, this attribute should support a
374379
list of aspects, similar to the `[[sycl::device_has()]]` attribute. This will

0 commit comments

Comments
 (0)