Skip to content

[SYCL] Make range::size() exception-free #15042

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 1 commit into from
Aug 13, 2024

Conversation

againull
Copy link
Contributor

@againull againull commented Aug 12, 2024

There is no need to use the detail::array::get() with bounds checking as it is guaranteed that we don't go out-of-bounds in this case, so just use underlying storage directly to calculate the size.

This is also necessary because accessor::size() and buffer::size() methods are noexcept by spec and their implementation use range::size();

@againull againull requested a review from a team as a code owner August 12, 2024 19:53
@againull againull requested a review from maarquitos14 August 12, 2024 19:53
There is no need to use operator[] of the detail::array with bounds checking
as it is guaranteed that we don't go out-of-bounds in this case, so just
use underlying storage directly to calculate the size.

This is also necessary because accessor::size() and buffer::size()
methods are noexcept by spec and their implementation use range::size();
@againull againull merged commit fe6e307 into intel:sycl Aug 13, 2024
13 checks passed
AlexeySachkov pushed a commit to AlexeySachkov/llvm that referenced this pull request Nov 26, 2024
There is no need to use the detail::array::get() with bounds checking as
it is guaranteed that we don't go out-of-bounds in this case, so just
use underlying storage directly to calculate the size.

This is also necessary because accessor::size() and buffer::size()
methods are noexcept by spec and their implementation use range::size();
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.

2 participants