Commit 37d75e5f authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'fix-cuda-qnx' into release-3.19

0832516b Help: Add 3.19 release note about CUDA support on QNX
bcdd486b

 CUDA: Enable support on QNX
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre's avatarRaul Tambre <raul@tambre.ee>
Merge-request: !5446
parents 15578c46 0832516b
Pipeline #198150 canceled with stages
in 1 minute and 25 seconds
...@@ -51,6 +51,8 @@ Languages ...@@ -51,6 +51,8 @@ Languages
- separable compilation (:prop_tgt:`CUDA_SEPARABLE_COMPILATION`), and - separable compilation (:prop_tgt:`CUDA_SEPARABLE_COMPILATION`), and
- finding scattered toolkit installations when cross-compiling. - finding scattered toolkit installations when cross-compiling.
* ``CUDA`` language support now works on QNX.
File-Based API File-Based API
-------------- --------------
......
...@@ -64,7 +64,7 @@ set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static") ...@@ -64,7 +64,7 @@ set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static")
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart") set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_SHARED "cudadevrt;cudart")
set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "") set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_NONE "")
if(UNIX) if(UNIX AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX"))
list(APPEND CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl") list(APPEND CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "rt" "pthread" "dl")
endif() endif()
......
...@@ -732,6 +732,8 @@ if(CMAKE_CROSSCOMPILING) ...@@ -732,6 +732,8 @@ if(CMAKE_CROSSCOMPILING)
# Support for aarch64 cross compilation # Support for aarch64 cross compilation
if (ANDROID_ARCH_NAME STREQUAL "arm64") if (ANDROID_ARCH_NAME STREQUAL "arm64")
set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi") set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux-androideabi")
elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(CUDA_TOOLKIT_TARGET_NAME "aarch64-qnx")
else() else()
set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux") set(CUDA_TOOLKIT_TARGET_NAME "aarch64-linux")
endif (ANDROID_ARCH_NAME STREQUAL "arm64") endif (ANDROID_ARCH_NAME STREQUAL "arm64")
...@@ -902,7 +904,7 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME) ...@@ -902,7 +904,7 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags}) set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags})
if(NOT APPLE) if(NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX"))
#On Linux, you must link against librt when using the static cuda runtime. #On Linux, you must link against librt when using the static cuda runtime.
find_library(CUDA_rt_LIBRARY rt) find_library(CUDA_rt_LIBRARY rt)
if (NOT CUDA_rt_LIBRARY) if (NOT CUDA_rt_LIBRARY)
......
...@@ -678,6 +678,8 @@ if(CMAKE_CROSSCOMPILING) ...@@ -678,6 +678,8 @@ if(CMAKE_CROSSCOMPILING)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
if(ANDROID_ARCH_NAME STREQUAL "arm64") if(ANDROID_ARCH_NAME STREQUAL "arm64")
set(CUDAToolkit_TARGET_NAME "aarch64-linux-androideabi") set(CUDAToolkit_TARGET_NAME "aarch64-linux-androideabi")
elseif (CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(CUDAToolkit_TARGET_NAME "aarch64-qnx")
else() else()
set(CUDAToolkit_TARGET_NAME "aarch64-linux") set(CUDAToolkit_TARGET_NAME "aarch64-linux")
endif(ANDROID_ARCH_NAME STREQUAL "arm64") endif(ANDROID_ARCH_NAME STREQUAL "arm64")
...@@ -860,7 +862,7 @@ if(CUDAToolkit_FOUND) ...@@ -860,7 +862,7 @@ if(CUDAToolkit_FOUND)
target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS}) target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS})
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE AND NOT (CMAKE_SYSTEM_NAME STREQUAL "QNX"))
# On Linux, you must link against librt when using the static cuda runtime. # On Linux, you must link against librt when using the static cuda runtime.
find_library(CUDAToolkit_rt_LIBRARY rt) find_library(CUDAToolkit_rt_LIBRARY rt)
mark_as_advanced(CUDAToolkit_rt_LIBRARY) mark_as_advanced(CUDAToolkit_rt_LIBRARY)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment