NVIDIA / cccl

CUDA Core Compute Libraries
https://nvidia.github.io/cccl/
Other
1.32k stars 168 forks source link

[BUG]: chrono does not define file_clock w/ -std=c++20 #2684

Open Artem-B opened 1 month ago

Artem-B commented 1 month ago

Is this a duplicate?

Type of Bug

Compile-time Error

Component

libcu++

Describe the bug

A handful of libcu++ tests are failing because chrono fails to define file_clock AKA cuda::std::filesystem::_FilesystemClock https://godbolt.org/z/xf59z9aqj

AFAICT, it happens because the definition is permanently ifdef'ed out here: https://github.com/NVIDIA/cccl/blob/b6323ce6a47b377d36f701ce6ce2efd830917db7/libcudacxx/include/cuda/std/detail/libcxx/include/chrono#L3647

... because __cuda_std__ is, effectively, always defined by __config here: https://github.com/NVIDIA/cccl/blob/b6323ce6a47b377d36f701ce6ce2efd830917db7/libcudacxx/include/cuda/std/detail/__config#L12

How to Reproduce

https://godbolt.org/z/xf59z9aqj

Expected behavior

cuda::std::chrono::file_clock is expected to exist, according to libcu++'s own tests. E.g. https://github.com/NVIDIA/cccl/blob/b6323ce6a47b377d36f701ce6ce2efd830917db7/libcudacxx/test/libcudacxx/std/utilities/time/time.clock/time.clock.file/rep_signed.pass.cpp#L26

Reproduction link

https://godbolt.org/z/xf59z9aqj

Operating System

No response

nvidia-smi output

No response

NVCC version

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Wed_Aug_14_10:10:22_PDT_2024 Cuda compilation tools, release 12.6, V12.6.68 Build cuda_12.6.r12.6/compiler.34714021_0

Artem-B commented 1 month ago

@griwes -- do you recall why the definition was definied conditionally besed on __cuda_std__ in 2a43bca2688a5f ?