Bug 5133216: Add QNX tooltrain and cross build support

This commit is contained in:
shawnz
2025-05-29 16:57:28 +08:00
parent 9c0d5aaae6
commit 49307463b5
16 changed files with 113 additions and 72 deletions

View File

@@ -19,6 +19,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
if(CMAKE_GENERATOR MATCHES "Visual Studio")
find_package(OpenMP REQUIRED C CXX)

View File

@@ -46,6 +46,14 @@ foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
list(APPEND GENCODE_FLAGS "-gencode=arch=compute_${arch},code=sm_${arch}")
endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}")
endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif()
add_custom_command(
OUTPUT ${CUDA_FATBIN_FILE}
COMMAND ${CMAKE_CUDA_COMPILER} ${INCLUDES} ${ALL_CCFLAGS} -Wno-deprecated-gpu-targets ${GENCODE_FLAGS} -o ${CUDA_FATBIN_FILE} -fatbin ${CUDA_KERNEL_SOURCE}

View File

@@ -37,6 +37,6 @@ target_link_libraries(matrixMulDynlinkJIT PUBLIC
CUDA::cuda_driver
)
if(UNIX)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(matrixMulDynlinkJIT PUBLIC dl)
endif()

View File

@@ -48,6 +48,14 @@ foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
list(APPEND GENCODE_FLAGS "-gencode=arch=compute_${arch},code=sm_${arch}")
endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}")
endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif()
add_custom_command(
OUTPUT ${CUDA_FATBIN_FILE}
COMMAND ${CMAKE_CUDA_COMPILER} ${INCLUDES} ${ALL_CCFLAGS} -Wno-deprecated-gpu-targets ${GENCODE_FLAGS} -o ${CUDA_FATBIN_FILE} -fatbin ${CUDA_KERNEL_SOURCE}

View File

@@ -45,6 +45,14 @@ foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
list(APPEND GENCODE_FLAGS "-gencode=arch=compute_${arch},code=sm_${arch}")
endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}")
endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif()
add_custom_command(
OUTPUT ${CUDA_FATBIN_FILE}
COMMAND ${CMAKE_CUDA_COMPILER} ${INCLUDES} ${ALL_CCFLAGS} -Wno-deprecated-gpu-targets ${GENCODE_FLAGS} -o ${CUDA_FATBIN_FILE} -fatbin ${CUDA_KERNEL_SOURCE}

View File

@@ -45,6 +45,14 @@ foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
list(APPEND GENCODE_FLAGS "-gencode=arch=compute_${arch},code=sm_${arch}")
endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}")
endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif()
add_custom_command(
OUTPUT ${CUDA_FATBIN_FILE}
COMMAND ${CMAKE_CUDA_COMPILER} ${INCLUDES} ${ALL_CCFLAGS} -Wno-deprecated-gpu-targets ${GENCODE_FLAGS} -o ${CUDA_FATBIN_FILE} -fatbin ${CUDA_KERNEL_SOURCE}

View File

@@ -50,6 +50,14 @@ foreach(arch ${CMAKE_CUDA_ARCHITECTURES})
list(APPEND GENCODE_FLAGS "-gencode=arch=compute_${arch},code=sm_${arch}")
endforeach()
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
set(INCLUDES_LIST)
foreach(dir ${CUDAToolkit_INCLUDE_DIRS})
list(APPEND INCLUDES_LIST "-I${dir}")
endforeach()
string(JOIN " " INCLUDES "${INCLUDES_LIST}")
endif()
add_custom_command(
OUTPUT ${CUDA_FATBIN_FILE}
COMMAND ${CMAKE_CUDA_COMPILER} ${INCLUDES} ${ALL_CCFLAGS} -Wno-deprecated-gpu-targets ${GENCODE_FLAGS} -o ${CUDA_FATBIN_FILE} -fatbin ${CUDA_KERNEL_SOURCE}

View File

@@ -18,6 +18,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
# Add target for bf16TensorCoreGemm
add_executable(bf16TensorCoreGemm bf16TensorCoreGemm.cu)

View File

@@ -17,6 +17,12 @@ else()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -lineinfo") # add line information to all builds for debug tools (exclusive to -G option)
endif()
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Include directories and libraries
include_directories(../../../Common)

View File

@@ -20,6 +20,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
# Add target for globalToShmemAsyncCopy
add_executable(globalToShmemAsyncCopy globalToShmemAsyncCopy.cu)

View File

@@ -20,6 +20,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
# Add target for tf32TensorCoreGemm
add_executable(tf32TensorCoreGemm tf32TensorCoreGemm.cu)

View File

@@ -21,6 +21,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
# Add target for conjugateGradientMultiBlockCG
add_executable(conjugateGradientMultiBlockCG conjugateGradientMultiBlockCG.cu)

View File

@@ -20,6 +20,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
# Add target for conjugateGradientMultiDeviceCG
add_executable(conjugateGradientMultiDeviceCG conjugateGradientMultiDeviceCG.cu)

View File

@@ -19,6 +19,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
# Add target for jitLto
add_executable(jitLto jitLto.cpp)

View File

@@ -19,6 +19,12 @@ endif()
# Include directories and libraries
include_directories(../../../Common)
# This sample is not supported on QNX
if(CMAKE_SYSTEM_NAME STREQUAL "QNX")
message(STATUS "Will not build sample ${PROJECT_NAME} - not supported on QNX")
return()
endif()
# Source file
# Add target for watershedSegmentationNPP
add_executable(watershedSegmentationNPP watershedSegmentationNPP.cpp)