File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed
clang/include/clang/Basic
sycl/include/sycl/ext/oneapi/device_global Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -1830,7 +1830,7 @@ def SYCLDeviceConstant: InheritableAttr {
18301830 let Subjects = SubjectList<[CXXRecord], ErrorDiag>;
18311831 let LangOpts = [SYCLIsDevice, SilentlyIgnoreSYCLIsHost];
18321832 // Only used internally by SYCL implementation
1833- let Documentation = [Undocumented ];
1833+ let Documentation = [SYCLDeviceConstantAttrDocs ];
18341834 let SimpleHandler = 1;
18351835}
18361836
Original file line number Diff line number Diff line change @@ -3579,6 +3579,26 @@ so we have this attribute in sycl_detail namespace.
35793579 }];
35803580}
35813581
3582+ def SYCLDeviceConstantAttrDocs : Documentation {
3583+ let Category = DocCatType;
3584+ let Heading = "__sycl_detail__::device_constant";
3585+ let Content = [{
3586+ This attribute is part of support for SYCL device_global feature.
3587+ [[__sycl_detail__::device_constant]] attribute is used for marking that a
3588+ device_global should use the device constant address space (if available).
3589+ We do not intend to support this as a general attribute that user code can use,
3590+ so we have this attribute in sycl_detail namespace.
3591+
3592+ .. code-block:: c++
3593+
3594+ template<typename T>
3595+ struct [[__sycl_detail__::device_global,
3596+ __sycl_detail__::device_constant]] device_global {}
3597+
3598+ device_global<int> Foo;
3599+ }];
3600+ }
3601+
35823602def SYCLGlobalVariableAllowedAttrDocs : Documentation {
35833603 let Category = DocCatType;
35843604 let Heading = "__sycl_detail__::global_variable_allowed";
Original file line number Diff line number Diff line change @@ -205,11 +205,12 @@ class
205205 " Property list is invalid." );
206206};
207207
208+ // Inherit the base class' constructors
208209#define DEVICE_GLOBAL_COMMON_METHODS () \
209- using detail::device_global_base< \
210- T, detail::properties_t <Props...>>::device_global_base; \
210+ using detail::device_global_base<T, property_list_t >::device_global_base; \
211211 \
212- device_global (const device_global &) = delete ; \
212+ constexpr device_global (const device_global &DG) \
213+ : base_t(static_cast <const base_t &>(DG)) {} \
213214 device_global (const device_global &&) = delete ; \
214215 device_global &operator =(const device_global &) = delete ; \
215216 device_global &operator =(const device_global &&) = delete ; \
You can’t perform that action at this time.
0 commit comments