passing flags to nvcc via CMake

CMake version: 3.12

target_compile_options(target PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
                       --generate-line-info
                       --use_fast_math
                       --relocatable-device-code=true
                       >)

cudadevrt should be linked by default since 3.12.

X-ref:VS: Link CUDA binaries with the device runtime library 'cudadevrt' (!2062) · Merge requests · CMake / CMake · GitLab

3 Likes