diff options
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/NVIDIA-CUDA.cmake | 24 | ||||
-rw-r--r-- | Modules/Compiler/NVIDIA-DetermineCompiler.cmake | 7 |
2 files changed, 31 insertions, 0 deletions
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake new file mode 100644 index 0000000..e3ff5e3 --- /dev/null +++ b/Modules/Compiler/NVIDIA-CUDA.cmake @@ -0,0 +1,24 @@ +set(CMAKE_CUDA_VERBOSE_FLAG "-v") + + +set(CMAKE_CUDA_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE) +set(CMAKE_CUDA_COMPILE_OPTIONS_PIC -Xcompiler=-fPIC) +#CMAKE_SHARED_LIBRARY_CUDA_FLAGS is sent to the host linker so we don' need +#to forward it through nvcc +set(CMAKE_SHARED_LIBRARY_CUDA_FLAGS -fPIC) +set(CMAKE_SHARED_LIBRARY_CREATE_CUDA_FLAGS -shared) +set(CMAKE_INCLUDE_SYSTEM_FLAG_CUDA -isystem=) +set(CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY -Xcompiler=-fvisibility=) + +set(CMAKE_CUDA_FLAGS_INIT " ") +set(CMAKE_CUDA_FLAGS_DEBUG_INIT " -g") +set(CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -Os -DNDEBUG") +set(CMAKE_CUDA_FLAGS_RELEASE_INIT " -O3 -DNDEBUG") +set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG") + +set(CMAKE_CUDA98_STANDARD_COMPILE_OPTION "") +set(CMAKE_CUDA98_EXTENSION_COMPILE_OPTION "") +set(CMAKE_CUDA11_STANDARD_COMPILE_OPTION "-std=c++11") +set(CMAKE_CUDA11_EXTENSION_COMPILE_OPTION "-std=c++11") + +set(CMAKE_CUDA_STANDARD_DEFAULT 98) diff --git a/Modules/Compiler/NVIDIA-DetermineCompiler.cmake b/Modules/Compiler/NVIDIA-DetermineCompiler.cmake new file mode 100644 index 0000000..32ccf8a --- /dev/null +++ b/Modules/Compiler/NVIDIA-DetermineCompiler.cmake @@ -0,0 +1,7 @@ + +set(_compiler_id_pp_test "defined(__NVCC__)") + +set(_compiler_id_version_compute " +# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__CUDACC_VER_MAJOR__) +# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__CUDACC_VER_MINOR__) +# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__CUDACC_VER_BUILD__)") |