-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Implement multi_ptr default to be legacy to avoid code break with SYCL 1.2.1 #10174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…to the access::decorated::legacy specialization of multi_ptr
…decorated::legacy
…ck to 1.2.1 version. - enable_if async_work_group_copy in group.hpp and nd_item.hpp when Dst and Src have the same type.
- Update tests to reflect deprecating access::decorated::legacy
@@ -662,6 +662,7 @@ class multi_ptr<void, Space, DecorateAddress> { | |||
template <typename ElementType, access::address_space Space> | |||
class multi_ptr<ElementType, Space, access::decorated::legacy> { | |||
public: | |||
using value_type = ElementType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not actually part of the spec, even after the changes from the mentioned spec PR. I have made a comment on it: https://github.com/KhronosGroup/SYCL-Docs/pull/432/files#r1251095640, but we should not add interfaces that aren't part of the spec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @steffenlarsen. I agree with you on above.
I would add it to spec for consistency with others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good catch, the PR used value_type
and it wasn't defined, I've created a new PR to make a change to the spec to introduce this (KhronosGroup/SYCL-Docs#437), so I think this change will be okay after that is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, thanks!
@@ -662,6 +662,7 @@ class multi_ptr<void, Space, DecorateAddress> { | |||
template <typename ElementType, access::address_space Space> | |||
class multi_ptr<ElementType, Space, access::decorated::legacy> { | |||
public: | |||
using value_type = ElementType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good catch, the PR used value_type
and it wasn't defined, I've created a new PR to make a change to the spec to introduce this (KhronosGroup/SYCL-Docs#437), so I think this change will be okay after that is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@intel/sycl-language-enabling-triage: FYI
@@ -1,12 +1,12 @@ | |||
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify %s -o %t.out | |||
// expected-no-diagnostics | |||
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that deprecation decorated::legacy
deprecation warnings are not the main thing we want to test here. Therefore, we can consider adding -Wno-deprecated
and leave the test as-is, i.e. expecting no diagnostics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AlexeySachkov , good point.
…ation. - Add get_raw / get_decorated in multi_ptr void/const void/ legacy specialisation.
- Use `const_cast` in `read_only` accessors to handle above update/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
"accessor::get_pointer() is deprecated, please use get_multi_ptr()") | ||
global_ptr<DataT> get_pointer() const noexcept { | ||
return global_ptr<DataT>( | ||
const_cast<typename detail::DecoratedType<DataT, AS>::type *>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Discussed offline. The deprecated API tries to be in line with SYCL 1.2.1, which means returning a DataT
pointer. However, with SYCL 2020 the value-type is changed to const when it is read-only. Instead of changing the internal representation, const_cast
for this deprecated API seemed like the lesser evil.
a friendly request for review please. @intel/dpcpp-esimd-reviewers |
friendly request for review please. https://github.com/orgs/intel/teams/dpcpp-esimd-reviewers |
get_pointer
interface for device, host and local_accessor back to 1.2.1 version.enable_if
async_work_group_copy
ingroup.hpp
andnd_item.hpp
to ensure Dst and Src(const / non-const) have the same type.