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

Size type of vecmem::jagged_device_vector should be unsigned int #96

Open
stephenswat opened this issue Aug 26, 2021 · 1 comment
Open
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@stephenswat
Copy link
Member

This is to bring it in sync with the jagged device vector. Having these two classes have different size types is unlikely to cause any real problems, but it is a little bit of sloppy design that I think we should fix.

@stephenswat stephenswat added bug Something isn't working good first issue Good for newcomers labels Aug 26, 2021
@stephenswat stephenswat self-assigned this Aug 26, 2021
@krasznaa
Copy link
Member

If you insist on making the two consistent, let's make vecmem::jagged_device_vector::size_type be unsigned int as well...

As it happens, vecmem::device_vector::size_type actually used to be std::size_t. I changed it on purpose when I introduced the ability to resize vectors on the device. This is because atomic operations with CUDA/HIP/SYCL are guaranteed to exist for unsigned int. But not necessarily for std::size_t!

So it's because we use atomic operations on this size that its type was made unsigned int...

@stephenswat stephenswat changed the title Size type of vecmem::device_vector should be std::size_t Size type of vecmem::jagged_device_vector should be unsigned int Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants