Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Reflect updates to get_pointer return type to relevant tests. #1670

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

mmoadeli
Copy link

Reflect updates to get_pointer return type to relevant tests.
intel/llvm#8493

@@ -122,22 +122,22 @@ template <typename T> int test(size_t Stride) {
size_t Offset = GrId * WorkGroupSize;
if (Stride == 1) { // Check the version without stride arg.
auto E = NDId.async_work_group_copy(
Local.get_pointer(), In.get_pointer() + Offset, NElemsToCopy);
local_ptr<T>(Local), In.get_pointer() + Offset, NElemsToCopy);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, this uses

template <typename ElementType,
          access::decorated IsDecorated = access::decorated::legacy>
using local_ptr

deprecated value (legacy) for access::decorated template param. Is that possible to use either yes or no instead?

Copy link
Author

@mmoadeli mmoadeli Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aelovikov-intel, Sounds reasonable, I would suggest doing so in another PR, though as it's not directly related to this one.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, one can argue that such a change would be independent of your intel/llvm PR and consequently make this one redundant as well.

Also, the spec for async_work_group_copy says it only accepts decorated_local_ptr so I'm not even sure what exactly happens here. Do we have an implicit conversion happening?

I guess I can give you an LGTM, but still...

@mmoadeli mmoadeli marked this pull request as draft March 20, 2023 20:48
@mmoadeli mmoadeli marked this pull request as ready for review March 20, 2023 21:34
@@ -122,22 +122,22 @@ template <typename T> int test(size_t Stride) {
size_t Offset = GrId * WorkGroupSize;
if (Stride == 1) { // Check the version without stride arg.
auto E = NDId.async_work_group_copy(
Local.get_pointer(), In.get_pointer() + Offset, NElemsToCopy);
local_ptr<T>(Local), In.get_pointer() + Offset, NElemsToCopy);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, one can argue that such a change would be independent of your intel/llvm PR and consequently make this one redundant as well.

Also, the spec for async_work_group_copy says it only accepts decorated_local_ptr so I'm not even sure what exactly happens here. Do we have an implicit conversion happening?

I guess I can give you an LGTM, but still...

@mmoadeli
Copy link
Author

@aelovikov-intel, thanks for the comments. An argument of async_work_group_copy is local_ptr which is a multi_ptr. In multi_ptr class there is an implicit conversion from local_accessor to multi_ptr.
The updates made in the corresponding PR changed the return type of get_pointer from local_ptr to T*. The changes in this PR provides local_ptr which is needed by async_work_group_copy.

@aelovikov-intel
Copy link

An argument of async_work_group_copy is local_ptr

In the specification or in the implementation? Because per the spec at https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#table.members.nditem, all of the overloads have some kind of decorated_*_ptr which is a multi_ptr with decorated::yes template parameter while local_ptr's default value is legacy.

@bader bader merged commit 02df4fc into intel:intel Mar 22, 2023
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants