Skip to content

[SYCL] Add half constexpr default constructor #4518

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 9 commits into from
Sep 13, 2021

Conversation

maximdimakov
Copy link
Contributor

@maximdimakov maximdimakov commented Sep 8, 2021

Add default constexpr constructor for half and host half classes, and also for half_vec struct.
Due to bitselect built-in uses union with half specialization, but object of a class without trivial constructor cannot be a member of union, the builtins_helper struct was added. This struct allow to use host half class instead of main half class in the builtin.

Signed-off-by: mdimakov [email protected]

@dm-vodopyanov
Copy link
Contributor

@maximdimakov, please add tests.
Also, can you please add info about builtins_helper from description to comments in the code?

@maximdimakov
Copy link
Contributor Author

maximdimakov commented Sep 10, 2021

@dm-vodopyanov I added clarifying comments and tests

@maximdimakov
Copy link
Contributor Author

@AlexeySachkov @dm-vodopyanov could you, please, review?

@dm-vodopyanov dm-vodopyanov merged commit d32a444 into intel:sycl Sep 13, 2021
romanovvlad pushed a commit that referenced this pull request Oct 4, 2021
Return trivial default constructor to half type. Without
default constructor it is impossible to create union with
half type. Changed implementation of marray and
half_vec constructors for optimizing them to use half
with trivial default constructor. Update files accordingly
to returned half trivial default constructor.
This patch corrects #4518

Signed-off-by: mdimakov [email protected]
@maximdimakov maximdimakov deleted the half_ctor branch March 24, 2022 13:59
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