NVIDIA / NVIDIA/cccl

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

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

Description

### Is this a duplicate?

- [x] I confirmed there appear to be no [duplicate issues](https://github.com/NVIDIA/cccl/issues) for this bug and that I agree to the [Code of Conduct](CODE_OF_CONDUCT.md)

### 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

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.