Skip to content

[SYCL] Avoid re-computing group_range in nd_item class #4621

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

Merged
merged 2 commits into from
Sep 23, 2021
Merged
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
7 changes: 2 additions & 5 deletions sycl/include/CL/sycl/nd_item.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ template <int dimensions = 1> class nd_item {
return Id;
}

range<dimensions> get_group_range() const {
return Group.get_global_range() / Group.get_local_range();
}
range<dimensions> get_group_range() const { return Group.get_group_range(); }

size_t __SYCL_ALWAYS_INLINE get_group_range(int dimension) const {
size_t Range =
Group.get_global_range(dimension) / Group.get_local_range(dimension);
size_t Range = Group.get_group_range(dimension);
__SYCL_ASSUME_INT(Range);
return Range;
}
Expand Down