According to this question , it is possible to use c++17 with cuda by using clang. However, I couldn't find how to setup CMakeLists.txt
to accomplish this.
I enable c++17 with
add_compile_options(-std=c++17)
Out of the box with the following
enable_language(CUDA)
nvcc
complains
nvcc fatal : Value 'c++17' is not defined for option 'std'
Adding the following as suggested here
set(CUDA_HOST_COMPILER clang++)
set(CMAKE_CUDA_COMPILER /usr/bin/clang++)
clang
to complain
clang: error: language not recognized: 'cu'
Try
set(CMAKE_CXX_STANDARD 17)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.