NVIDIA / NVIDIA/cccl

Add support for std::this_thread::sleep_for

Open
#958 1 comment 0 reactions 1 assignee Claimed by @griwes View on GitHub
libcu++
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

There seems to be an issue with `chrono::duration` being host only.

` std::this_thread::sleep_for(std::chrono::microseconds(1));`

generates the following compilation error:

`error: calling a constexpr __host__ function("duration") from a __device__ function("GetEventIndex") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.`

Trying to replace `std::chrono` by `cuda::std::chrono` causes a different compilation error

`error: no instance of function template "std::this_thread::sleep_for" matches the argument list
argument types are: (cuda::std::__3::chrono::microseconds)`

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.