Skip to content

[SYCL] Align id and range class implementation with SYCL specification - #4538

Merged
romanovvlad merged 4 commits into
intel:syclfrom
dsawfer:conversion_deprecation
Sep 13, 2021
Merged

[SYCL] Align id and range class implementation with SYCL specification#4538
romanovvlad merged 4 commits into
intel:syclfrom
dsawfer:conversion_deprecation

Conversation

@dsawfer

@dsawfer dsawfer commented Sep 10, 2021

Copy link
Copy Markdown
Contributor

"range" and "id" did not correspond to the SYCL 2020 specification: the binary operators were corrected, the necessary operators were added, unnecessary operators were deprecated.

@dsawfer
dsawfer requested a review from a team as a code owner September 10, 2021 10:00
@dsawfer
dsawfer requested a review from romanovvlad September 10, 2021 10:00
@bader bader changed the title [SYCL] Changes id and range class according to sycl specification [SYCL] Align id and range class implementation with SYCL specification Sep 10, 2021
@romanovvlad

Copy link
Copy Markdown
Contributor

"range" and "id" did not correspond to the SYCL 2020 specification: the binary operators were corrected, the necessary operators were added, unnecessary operators were deprecated.

Could you please provide more details on how exactly range and id does not correspond to the SYCL2020 spec?

@dsawfer

dsawfer commented Sep 10, 2021

Copy link
Copy Markdown
Contributor Author

"range" and "id" did not correspond to the SYCL 2020 specification: the binary operators were corrected, the necessary operators were added, unnecessary operators were deprecated.

Could you please provide more details on how exactly range and id does not correspond to the SYCL2020 spec?

The DPC++ "range" implementation has a conversion to "id", which is not in the spec, and "id" implementation has a conversion to "range", which is also not in the spec.

As for operators:
The 16 binary operators "+, -, *, /, %, <<, >>, &, |, ^, &&, ||, <, >, <=, >=" are defined as either member functions or hidden friend functions depending on the arguments. However, the spec defines these operators as hidden friend functions for all argument variations.
The 16 binary operators are defined as templates that take any integral type, but the spec defines these operators only for "size_t".
The 10 assignment operators "+=, -=, *=, /=, %=, <<=, >>=, &=, |=, ^=" are defined as member functions, but the spec defines them as hidden friend functions.

In addition, DPC++ is missing the following hidden friend functions which are defined in the spec:
Unary "+" and "-".
Prefix "++" and "--"
Postfix "++" and "--"

Here are pointers to the relevant parts of the spec:
https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#range-class
https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html#id-class

@romanovvlad

Copy link
Copy Markdown
Contributor

/summary:run

Comment thread sycl/test/basic_tests/id.cpp Outdated
Comment thread sycl/test/basic_tests/id.cpp
Comment thread sycl/include/CL/sycl/range.hpp
Comment thread sycl/include/CL/sycl/range.hpp Outdated
Comment thread sycl/test/warnings/conversion_deprecation.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants