Skip to content

[FEA]: make bit_cast compatible with raw narrow precision types #2422

Description

@fbusato

Is this a duplicate?

Area

libcu++

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

__half, __half2, __nv_bfloat16, __nv_bfloat162 are not trivially copyable and, for this reason, bit_cast doesn't support them.

Looking at their implementations, they are simply defined on top of an unsigned short. There is no special semantic. Only the interface definition prevents a trivial copy.

Describe the solution you'd like

extend bit_cast to support narrow precision types. If not possible in cuda::std, I would propose another version in cuda::

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. miscco commented on Sep 19, 2024

    @miscco
    Contributor

    That is definitely something we can and maybe should support. I believe we should reorganize our extended floating point support a bit because we are accumulating more and more special treatment for those

  2. moved this from Todo to In Review in CCCLon Sep 19, 2024
  3. moved this from In Review to Done in CCCLon Sep 20, 2024
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

    No labels
    No labels

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions