在 cuda 的 nvcc 编译器中使用 C++20

Using C++20 in the nvcc compiler for cuda

我正在尝试使用 <bitset> 库中的 std::countr_zero() 函数,但我不确定应该如何配置我的 nvcc 编译器,因为我确定它不是使用 C++20 版本。

NVCC 目前不支持 C++20。事实上,C++17 支持非常新(2020 年 11 月;参见 NVCC versions). You can find more information here and there。改用 Clang 可能会帮助您(部分)使用 C++20。