Skip to content
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
2 changes: 2 additions & 0 deletions sycl/include/CL/sycl/group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ template <int Dimensions = 1> class group {
#endif
}

size_t get_local_id(int dimention) const { return get_local_id()[dimention]; }

size_t get_local_linear_id() const {
return get_local_linear_id_impl<Dimensions>();
}
Expand Down
6 changes: 6 additions & 0 deletions sycl/test/basic_tests/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ int main() {

try {
one_dim.get_local_id();
assert(one_dim.get_local_id(0) == one_dim.get_local_id()[0]);
assert(0); // get_local_id() is not implemented on host device
} catch (cl::sycl::runtime_error) {
}
Expand Down Expand Up @@ -64,6 +65,8 @@ int main() {

try {
two_dim.get_local_id();
assert(two_dim.get_local_id(0) == two_dim.get_local_id()[0]);
assert(two_dim.get_local_id(1) == two_dim.get_local_id()[1]);
assert(0); // get_local_id() is not implemented on host device
} catch (cl::sycl::runtime_error) {
}
Expand Down Expand Up @@ -101,6 +104,9 @@ int main() {

try {
three_dim.get_local_id();
assert(three_dim.get_local_id(0) == three_dim.get_local_id()[0]);
assert(three_dim.get_local_id(1) == three_dim.get_local_id()[1]);
assert(three_dim.get_local_id(2) == three_dim.get_local_id()[2]);
assert(0); // get_local_id() is not implemented on host device
} catch (cl::sycl::runtime_error) {
}
Expand Down