Skip to content

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

Open

Description

@PointKernel

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

Activity

  1. sleeepyjack commented on Jul 22, 2024

    @sleeepyjack
    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.

  2. sleeepyjack commented on Jul 22, 2024

    @sleeepyjack
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1: Should haveNecessary but not criticaltype: improvementImprovement / enhancement to an existing function

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions