diff --git a/Common/helper_multiprocess.cpp b/Common/helper_multiprocess.cpp index 801b205d..1e2d9255 100644 --- a/Common/helper_multiprocess.cpp +++ b/Common/helper_multiprocess.cpp @@ -222,10 +222,10 @@ int ipcOpenSocket(ipcHandle *&handle) { memset(&cliaddr, 0, sizeof(cliaddr)); cliaddr.sun_family = AF_UNIX; - char temp[10]; + char temp[20]; // Create unique name for the socket. - sprintf(temp, "%u", getpid()); + sprintf(temp, "%s%u", SOCK_FOLDER, getpid()); strcpy(cliaddr.sun_path, temp); if (bind(sock, (struct sockaddr *)&cliaddr, sizeof(cliaddr)) < 0) { @@ -361,8 +361,8 @@ int ipcSendShareableHandle(ipcHandle *handle, // Construct client address to send this SHareable handle to memset(&cliaddr, 0, sizeof(cliaddr)); cliaddr.sun_family = AF_UNIX; - char temp[10]; - sprintf(temp, "%u", process); + char temp[20]; + sprintf(temp, "%s%u", SOCK_FOLDER, process); strcpy(cliaddr.sun_path, temp); len = sizeof(cliaddr); diff --git a/Common/helper_multiprocess.h b/Common/helper_multiprocess.h index 5c760718..d0bdcc20 100644 --- a/Common/helper_multiprocess.h +++ b/Common/helper_multiprocess.h @@ -54,6 +54,13 @@ #endif #include +// Define "/tmp" as socket creating folder for QNX +#if defined(__QNX__) +#define SOCK_FOLDER "/tmp/" +#else +#define SOCK_FOLDER "" +#endif + typedef struct sharedMemoryInfo_st { void *addr; size_t size; diff --git a/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt b/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt index 5cdb581c..c777fbd6 100644 --- a/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt +++ b/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt @@ -49,7 +49,7 @@ endforeach() if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(INCLUDES_LIST) foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) - list(APPEND INCLUDES_LIST "-I${dir}") + list(APPEND INCLUDES_LIST "-I${dir}") endforeach() string(JOIN " " INCLUDES "${INCLUDES_LIST}") endif() diff --git a/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt b/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt index 04684da2..0774b4d5 100644 --- a/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt +++ b/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt @@ -51,7 +51,7 @@ endforeach() if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(INCLUDES_LIST) foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) - list(APPEND INCLUDES_LIST "-I${dir}") + list(APPEND INCLUDES_LIST "-I${dir}") endforeach() string(JOIN " " INCLUDES "${INCLUDES_LIST}") endif() diff --git a/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt b/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt index befbfd05..19f7f079 100644 --- a/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt +++ b/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt @@ -48,7 +48,7 @@ endforeach() if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(INCLUDES_LIST) foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) - list(APPEND INCLUDES_LIST "-I${dir}") + list(APPEND INCLUDES_LIST "-I${dir}") endforeach() string(JOIN " " INCLUDES "${INCLUDES_LIST}") endif() diff --git a/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt b/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt index abbef92e..0b6a3477 100644 --- a/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt +++ b/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt @@ -48,7 +48,7 @@ endforeach() if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(INCLUDES_LIST) foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) - list(APPEND INCLUDES_LIST "-I${dir}") + list(APPEND INCLUDES_LIST "-I${dir}") endforeach() string(JOIN " " INCLUDES "${INCLUDES_LIST}") endif() diff --git a/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt index ab3ac87a..cd04098a 100644 --- a/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt @@ -53,7 +53,7 @@ endforeach() if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(INCLUDES_LIST) foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) - list(APPEND INCLUDES_LIST "-I${dir}") + list(APPEND INCLUDES_LIST "-I${dir}") endforeach() string(JOIN " " INCLUDES "${INCLUDES_LIST}") endif() diff --git a/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt b/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt index c7a147c2..edbd7698 100644 --- a/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt @@ -17,6 +17,15 @@ else() set(CMAKE_CUDA_ARCHITECTURES 75 80 86 89 90 100 110 120) endif() +set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Wno-deprecated-gpu-targets") + +if(ENABLE_CUDA_DEBUG) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (may significantly affect performance on some targets) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -maxrregcount=64") # Limit register usage to 64 for the 'big_bitonicsort kernel +else() + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -lineinfo") # add line information to all builds for debug tools (exclusive to -G option) +endif() + # Include directories and libraries include_directories(../../../Common) diff --git a/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt b/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt index b2066843..b57e9187 100644 --- a/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt +++ b/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt @@ -51,7 +51,7 @@ set(CUDA_KERNEL_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/memMapIpc_kernel.cu") if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(INCLUDES_LIST) foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) - list(APPEND INCLUDES_LIST "-I${dir}") + list(APPEND INCLUDES_LIST "-I${dir}") endforeach() string(JOIN " " INCLUDES "${INCLUDES_LIST}") endif() diff --git a/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt b/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt index ea9e305f..575949b0 100644 --- a/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt +++ b/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt @@ -44,7 +44,7 @@ set(CUDA_KERNEL_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/ptxjit_kernel.cu") if(CMAKE_SYSTEM_NAME STREQUAL "QNX") set(INCLUDES_LIST) foreach(dir ${CUDAToolkit_INCLUDE_DIRS}) - list(APPEND INCLUDES_LIST "-I${dir}") + list(APPEND INCLUDES_LIST "-I${dir}") endforeach() string(JOIN " " INCLUDES "${INCLUDES_LIST}") endif()