diff --git a/sycl/include/CL/sycl/group.hpp b/sycl/include/CL/sycl/group.hpp index 566b481a9fbb3..b6b338fee9d2f 100644 --- a/sycl/include/CL/sycl/group.hpp +++ b/sycl/include/CL/sycl/group.hpp @@ -133,6 +133,8 @@ template 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(); } diff --git a/sycl/test/basic_tests/group.cpp b/sycl/test/basic_tests/group.cpp index 2142a91ff9b7b..19423391f14f1 100644 --- a/sycl/test/basic_tests/group.cpp +++ b/sycl/test/basic_tests/group.cpp @@ -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) { } @@ -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) { } @@ -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) { }