diff --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt --- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt +++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt @@ -56,6 +56,7 @@ ${devicertl_common_directory}/src/data_sharing.cu ${devicertl_common_directory}/src/libcall.cu ${devicertl_common_directory}/src/loop.cu + ${devicertl_common_directory}/src/omp_data.cu ${devicertl_common_directory}/src/omptarget.cu ${devicertl_common_directory}/src/parallel.cu ${devicertl_common_directory}/src/reduction.cu @@ -65,8 +66,6 @@ src/target_impl.cu ) - set(omp_data_objects ${devicertl_common_directory}/src/omp_data.cu) - # Build library support for the highest compute capability the system supports # and always build support for sm_35 by default if (${LIBOMPTARGET_DEP_CUDA_ARCH} EQUAL 35) @@ -95,24 +94,6 @@ # Activate RTL message dumps if requested by the user. set(LIBOMPTARGET_NVPTX_DEBUG FALSE CACHE BOOL "Activate NVPTX device RTL debug messages.") - if(${LIBOMPTARGET_NVPTX_DEBUG}) - set(CUDA_DEBUG -DOMPTARGET_NVPTX_DEBUG=-1 -g --ptxas-options=-v) - endif() - - # NVPTX runtime library has to be statically linked. Dynamic linking is not - # yet supported by the CUDA toolchain on the device. - set(BUILD_SHARED_LIBS OFF) - set(CUDA_SEPARABLE_COMPILATION ON) - list(APPEND CUDA_NVCC_FLAGS -I${devicertl_base_directory} - -I${devicertl_nvptx_directory}/src) - cuda_add_library(omptarget-nvptx STATIC ${cuda_src_files} ${omp_data_objects} - OPTIONS ${CUDA_ARCH} ${CUDA_DEBUG} ${MAX_SM_DEFINITION}) - - # Install device RTL under the lib destination folder. - install(TARGETS omptarget-nvptx ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}") - - target_link_libraries(omptarget-nvptx ${CUDA_LIBRARIES}) - # Check if we can create an LLVM bitcode implementation of the runtime library # that could be inlined in the user application. For that we need to find @@ -196,7 +177,7 @@ # Copy library to destination. add_custom_command(TARGET omptarget-nvptx-${sm}-bc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libomptarget-nvptx-sm_${sm}.bc - $) + ${LIBOMPTARGET_LIBRARY_DIR}) # Install bitcode library under the lib destination folder. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libomptarget-nvptx-sm_${sm}.bc DESTINATION "${OPENMP_INSTALL_LIBDIR}")