NVIDIA / NVIDIA/cccl

[BUG] 128bit integers are not supported on device code

Open
#1,227 1 comment 0 reactions 0 assignees View on GitHub
libcu++
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

### Discussed in https://github.com/NVIDIA/cccl/discussions/1226

Originally posted by **to-mas-kral** December 17, 2023
I'm trying to compile a program which uses libcu++ to the OptiX-IR format.

The compilation fails with:
```/opt/cuda/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/__utility/convert_to_integral.h(53): error: "__int128_t (__int128_t)" contains a 128-bit integer, which is not supported in device code
__int128_t __convert_to_integral(__int128_t __val) { return __val; }
^

/opt/cuda/bin/../targets/x86_64-linux/include/cuda/std/detail/libcxx/include/__utility/convert_to_integral.h(56): error: "__uint128_t (__uint128_t)" contains a 128-bit integer, which is not supported in device code
__uint128_t __convert_to_integral(__uint128_t __val) { return __val; }
```

I want to ask if this is something that's supposed to work or if it's just unsupported. If this is a bug, should I report it to the libcu++ team or the OptiX team ?

System information:
`nvcc --version`
`
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Nov__3_17:16:49_PDT_2023
Cuda compilation tools, release 12.3, V12.3.103
Build cuda_12.3.r12.3/compiler.33492891_0
`

`/opt/cuda/bin/g++ --version`
`
g++ (GCC) 12.3.0
Copyright (C) 2022 Free Software Foundation, Inc.
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.