Skip to content
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

Using vector<unsigned char> instead of vector<bool> #827

Merged
merged 4 commits into from
Nov 9, 2023
Merged

Using vector<unsigned char> instead of vector<bool> #827

merged 4 commits into from
Nov 9, 2023

Conversation

ChengChen002
Copy link
Contributor

@ChengChen002 ChengChen002 commented Nov 3, 2023

Since the std::vector<bool> type does not have a data() member function,
Using vector instead of vector.

@ChengChen002 ChengChen002 requested a review from a team as a code owner November 3, 2023 07:47
@ChengChen002 ChengChen002 changed the title template specialization for event_generator<bool, buf_size> Template specialization for event_generator<bool, buf_size> Nov 3, 2023
@ChengChen002
Copy link
Contributor Author

I haven't come up with a cleaner way to fix this yet, please comment if you have any other suggestions! Thanks.

@ChengChen002 ChengChen002 marked this pull request as draft November 3, 2023 08:33
@bader
Copy link
Contributor

bader commented Nov 3, 2023

I haven't come up with a cleaner way to fix this yet, please comment if you have any other suggestions! Thanks.

Please, push "Ready for review" button if you want this PR to be reviewed.

@bader bader added the help wanted Extra attention is needed label Nov 3, 2023
Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks correct but there is a lot of code duplication.
I was thinking about introducing a generic container type that would select either a std::vector or a std::array according to the value type, but thinking again, why not just using always a std::array?

@ChengChen002
Copy link
Contributor Author

This looks correct but there is a lot of code duplication. I was thinking about introducing a generic container type that would select either a std::vector or a std::array according to the value type, but thinking again, why not just using always a std::array?

This is to avoid using too much stack memory, you can see more information in #823.

@ChengChen002 ChengChen002 marked this pull request as ready for review November 6, 2023 03:21
@ChengChen002 ChengChen002 changed the title Template specialization for event_generator<bool, buf_size> Using vector<unsigned char> instead of vector<bool> Nov 6, 2023
@bader bader requested a review from keryell November 6, 2023 19:32
Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I love shorter code for maintenance. :-)

tests/usm/usm_api.h Outdated Show resolved Hide resolved
Co-authored-by: Ronan Keryell <[email protected]>
@bader bader requested a review from keryell November 8, 2023 02:49
tests/usm/usm_api.h Outdated Show resolved Hide resolved
Copy link
Member

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bader bader merged commit 2e6e6a2 into KhronosGroup:SYCL-2020 Nov 9, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants