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 @@ -50,6 +50,7 @@ # propagating host flags. set(CUDA_PROPAGATE_HOST_FLAGS OFF) + # Note: These files are also listed in unity.cu set(cuda_src_files ${devicertl_common_directory}/src/cancel.cu ${devicertl_common_directory}/src/critical.cu @@ -95,7 +96,7 @@ 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} + cuda_add_library(omptarget-nvptx STATIC unity.cu OPTIONS ${CUDA_ARCH} ${CUDA_DEBUG}) # Install device RTL under the lib destination folder. diff --git a/openmp/libomptarget/deviceRTLs/nvptx/unity.cu b/openmp/libomptarget/deviceRTLs/nvptx/unity.cu new file mode 100644 --- /dev/null +++ b/openmp/libomptarget/deviceRTLs/nvptx/unity.cu @@ -0,0 +1,27 @@ +//===------ unity.cu - Unity build of NVPTX deviceRTL ------------ CUDA -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// Support compilers, specifically NVCC, which have not implemented link time +// optimisation. This removes the runtime cost of moving inline functions into +// source files in exchange for negligible build overhead. +// +//===----------------------------------------------------------------------===// + +#include "common/src/cancel.cu" +#include "common/src/critical.cu" +#include "common/src/data_sharing.cu" +#include "common/src/libcall.cu" +#include "common/src/loop.cu" +#include "common/src/omp_data.cu" +#include "common/src/omptarget.cu" +#include "common/src/parallel.cu" +#include "common/src/reduction.cu" +#include "common/src/support.cu" +#include "common/src/sync.cu" +#include "common/src/task.cu" +#include "src/target_impl.cu"