Skip to content

[clang-cuda] clang segfaults when trying to convert a float to a 128 bit integer on device #149080

@miscco

Description

@miscco

consider the following minimal reproducer:

__global__ void kernel() {
    float meow = 1.0f;
#if 1 
    [[maybe_unused]] auto val = static_cast<__int128_t>(meow);
#else
    [[maybe_unused]] auto val = static_cast<__int128_t>(static_cast<int>(meow));
#endif
}

int main() {
    float meow = 1.0f;
    auto val = __int128_t(meow);
    kernel<<<1, 1>>>();
    return 0;
}

This will fail with

fatal error: error in backend: unsupported library call operation
clang++: error: clang frontend command failed with exit code 70 (use -v to see invocation)

It would be awesome if the library call could be implemented for the 128 bit integers and all builtin types

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions