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

[ENHANCEMENT]: Update build-time check since the trunk CCCL allows 1B/2B atomic_ref #554

Open
PointKernel opened this issue Jul 21, 2024 · 2 comments
Labels
P1: Should have Necessary but not critical type: improvement Improvement / enhancement to an existing function

Comments

@PointKernel
Copy link
Member

Is your feature request related to a problem? Please describe.

https://godbolt.org/z/a78x4qrha

Originally posted by @sleeepyjack #549 (comment)

Now cuda::atomic_ref can work with 1-byte and 2-byte variables so we need to update the static asserts accordingly in cuco data structures, e.g.

static_assert(sizeof(T) == 4 or sizeof(T) == 8,
"sizeof(mapped_type) must be either 4 bytes or 8 bytes.");

using packed_type = cuda::std::conditional_t<sizeof(value_type) == 4, uint32_t, uint64_t>;

Describe the solution you'd like

Update build checks and unit tests

Describe alternatives you've considered

No response

Additional context

No response

@PointKernel PointKernel added P1: Should have Necessary but not critical type: improvement Improvement / enhancement to an existing function labels Jul 21, 2024
@sleeepyjack
Copy link
Collaborator

Having the same build time checks all over the library isn't ideal. Maybe this is an opportunity to refactor this whole insertion logic into a separate struct slot_inserter that internally decides which insertion strategy to use and also checks if the input types can be handled at all. Let me draft something in Godbolt.

@sleeepyjack
Copy link
Collaborator

Something like this: https://godbolt.org/z/nvGGYaPWa

This would also solve #547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1: Should have Necessary but not critical type: improvement Improvement / enhancement to an existing function
Projects
None yet
Development

No branches or pull requests

2 participants