summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Chesterfield <jonathanchesterfield@gmail.com>2019-10-31 01:58:29 +0000
committerJonChesterfield <jonathanchesterfield@gmail.com>2019-10-31 01:58:51 +0000
commite9f9dfab82bbaadc6b6d8d0eafba017ef5d94fd0 (patch)
tree9b40b041442b8bf04fc9b27bbe568b0ae0cb281b
parent0be9cf2da9c1400eea720f0c6bead3df07c98a9c (diff)
downloadbcm5719-llvm-e9f9dfab82bbaadc6b6d8d0eafba017ef5d94fd0.tar.gz
bcm5719-llvm-e9f9dfab82bbaadc6b6d8d0eafba017ef5d94fd0.zip
[libomptarget] Change nvcc compilation to use a unity build
Summary: [libomptarget] Change nvcc compilation to use a unity build This allows nvcc to inline functions between what would otherwise be distinct translation units, which in turn removes any runtime cost from implementing functions in source files (as opposed to inline in headers). This will then allow the circular dependencies in deviceRTL to be readily broken and individual components more easily shared between architectures. Reviewers: ABataev, jdoerfert, grokos, RaviNarayanaswamy, hfinkel, ronlieb, gregrodgers Reviewed By: jdoerfert Subscribers: mgorny, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D69489
-rw-r--r--openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt2
-rw-r--r--openmp/libomptarget/deviceRTLs/nvptx/unity.cu25
2 files changed, 26 insertions, 1 deletions
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
index 1cd13c50395..caf02d62c59 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -88,7 +88,7 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND)
set(BUILD_SHARED_LIBS OFF)
set(CUDA_SEPARABLE_COMPILATION ON)
list(APPEND CUDA_NVCC_FLAGS -I${devicertl_base_directory})
- 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
index 00000000000..b6cfd0d8b9a
--- /dev/null
+++ b/openmp/libomptarget/deviceRTLs/nvptx/unity.cu
@@ -0,0 +1,25 @@
+//===------ 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 preventing efficient incremental builds.
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/cancel.cu"
+#include "src/critical.cu"
+#include "src/data_sharing.cu"
+#include "src/libcall.cu"
+#include "src/loop.cu"
+#include "src/omp_data.cu"
+#include "src/omptarget-nvptx.cu"
+#include "src/parallel.cu"
+#include "src/reduction.cu"
+#include "src/sync.cu"
+#include "src/task.cu"
OpenPOWER on IntegriCloud