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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions SYCL/Basic/group_async_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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...

E.wait();
} else {
auto E = NDId.async_work_group_copy(Local.get_pointer(),
auto E = NDId.async_work_group_copy(local_ptr<T>(Local),
In.get_pointer() + Offset,
NElemsToCopy, Stride);
E.wait();
}

if (Stride == 1) { // Check the version without stride arg.
auto E = Group.async_work_group_copy(
Out.get_pointer() + Offset, Local.get_pointer(), NElemsToCopy);
Out.get_pointer() + Offset, local_ptr<T>(Local), NElemsToCopy);
Group.wait_for(E);
} else {
auto E = Group.async_work_group_copy(Out.get_pointer() + Offset,
Local.get_pointer(), NElemsToCopy,
local_ptr<T>(Local), NElemsToCopy,
Stride);
Group.wait_for(E);
}
Expand Down
2 changes: 1 addition & 1 deletion SYCL/Regression/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ bool group__async_work_group_copy() {
const auto Off = Group[0] * I.get_group_range(1) * NumElem +
Group[1] * I.get_local_range(1);
auto PtrGlobal = AccGlobal.get_pointer() + Off;
auto PtrLocal = AccLocal.get_pointer();
auto PtrLocal = local_ptr<DataType>(AccLocal);
if (I.get_local_range(0) == 1) {
Group.async_work_group_copy(PtrLocal, PtrGlobal, NumElem);
} else {
Expand Down