Usage of a library (has c++20-standard without CUDA) in a CUDA program

Good day to all,

The following situation:
I am using CMake and I have created two libraries over it that use C++20 standard. Now I want to build a CUDA program that uses the two libraries.

My versions:
CMake: 3.17
Cuda: 10.1
C++ compiler: Clang 10


  1. Is this even possible to implement because CUDA and the two libraries support different C++ standards?
  2. If yes on 1), are there any special procedures or commands I can use in CMakeLists.txt accordingly.

I imagine it is possible. At a minimum, if you use wrapper functions between the CUDA modules and the C++20 modules, I think that should work, if your wrapper functions don’t use C++20 features.

CUDA 10.1 does not support Clang 10 as a host compiler, so that wouldn’t be my choice of versions to use. If it were me, I’d move to the latest CUDA version (11.3, which supports up to clang 11) if you want to do this.

I can’t help with CMake. It’s not something I use regularly, and its not a NVIDIA product. If I’m doing something new, I usually try to make sure I understand the compile and link process using basic tools and that I know how to make things work correctly, before tackling CMake.

ok… thank you for help. I will try that.