File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ template <int Dimensions = 1> class group {
133133#endif
134134 }
135135
136+ size_t get_local_id (int dimention) const { return get_local_id ()[dimention]; }
137+
136138 size_t get_local_linear_id () const {
137139 return get_local_linear_id_impl<Dimensions>();
138140 }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ int main() {
3333
3434 try {
3535 one_dim.get_local_id ();
36+ assert (one_dim.get_local_id (0 ) == one_dim.get_local_id ()[0 ]);
3637 assert (0 ); // get_local_id() is not implemented on host device
3738 } catch (cl::sycl::runtime_error) {
3839 }
@@ -64,6 +65,8 @@ int main() {
6465
6566 try {
6667 two_dim.get_local_id ();
68+ assert (two_dim.get_local_id (0 ) == two_dim.get_local_id ()[0 ]);
69+ assert (two_dim.get_local_id (1 ) == two_dim.get_local_id ()[1 ]);
6770 assert (0 ); // get_local_id() is not implemented on host device
6871 } catch (cl::sycl::runtime_error) {
6972 }
@@ -101,6 +104,9 @@ int main() {
101104
102105 try {
103106 three_dim.get_local_id ();
107+ assert (three_dim.get_local_id (0 ) == three_dim.get_local_id ()[0 ]);
108+ assert (three_dim.get_local_id (1 ) == three_dim.get_local_id ()[1 ]);
109+ assert (three_dim.get_local_id (2 ) == three_dim.get_local_id ()[2 ]);
104110 assert (0 ); // get_local_id() is not implemented on host device
105111 } catch (cl::sycl::runtime_error) {
106112 }
You can’t perform that action at this time.
0 commit comments