5

I'm trying to use the std::countr_zero() function from the <bitset> library, but I'm not sure how I'm supposed to configure my nvcc compiler as I'm sure it's not using the C++20 version.

Existentialist
  • 177
  • 2
  • 9

1 Answers1

10

CUDA 12 and above supports the C++20 standard.

You can find answers to your question more generally by checking Nvidia's standards C++ language support docs and this compiler support for language features page.

In visual studio you can enable c++20 support by adding the command line option --std c++20 (Note no =) to the CUDA C/C++ Command line options in your project options.

enter image description here

Johan
  • 74,508
  • 24
  • 191
  • 319
Jérôme Richard
  • 41,678
  • 6
  • 29
  • 59