From 1bae1d4607af00a5ae9155decaefada297521931 Mon Sep 17 00:00:00 2001 From: Greg Lueck Date: Wed, 16 Feb 2022 09:14:04 -0500 Subject: [PATCH] [SYCL][DOC] Clarify "[[uses_aspects()]]" in design 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`. --- sycl/doc/design/OptionalDeviceFeatures.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sycl/doc/design/OptionalDeviceFeatures.md b/sycl/doc/design/OptionalDeviceFeatures.md index 787d2bb9994ce..09406602d61dd 100644 --- a/sycl/doc/design/OptionalDeviceFeatures.md +++ b/sycl/doc/design/OptionalDeviceFeatures.md @@ -369,6 +369,11 @@ instantiations of `sycl::atomic_ref` as an optional feature. [6]: <#appendix-adding-an-attribute-to-8-byte-atomic_ref> +Because the `[[sycl_detail::uses_aspects()]]` attribute is only needed for the +device compiler, the headers should protect it with +`#ifdef __SYCL_DEVICE_ONLY__`. This avoids warnings when our headers are +compiled with a third-party host compiler. + Although the examples above show only a single aspect parameter to the `[[sycl_detail::uses_aspects()]]` attribute, this attribute should support a list of aspects, similar to the `[[sycl::device_has()]]` attribute. This will