[Openmp-commits] [openmp] [Libomptarget] Do not pass 'nogpulib' to the non-LTO Nvidia tests (PR #70327)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Thu Oct 26 06:20:33 PDT 2023


https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/70327

Summary:
For the other tests we pass `-nogpulib` to ensure that we set up the
needed libraries correctly. However, this caused problems for the
non-LTO build and test of Nvidia systems. In general this is because we
would do a separate compile of the libomptarget device runtime and then
link in that cubin. This exercised the runtime in a lot of ways it's not
used to, since doing things this way was hardly expected or tested. This
patch disables it only for the Nvidia non-LTO build so that we still get
the effect of `--liboimptarget-nvptx-bc-path` rather than ignoring it.


>From 0ef6310e88b61281c7fcb371f6d9ddad0e2ada18 Mon Sep 17 00:00:00 2001
From: Joseph Huber <jhuber6 at vols.utk.edu>
Date: Thu, 26 Oct 2023 08:17:48 -0500
Subject: [PATCH] [Libomptarget] Do not pass 'nogpulib' to the non-LTO Nvidia
 tests

Summary:
For the other tests we pass `-nogpulib` to ensure that we set up the
needed libraries correctly. However, this caused problems for the
non-LTO build and test of Nvidia systems. In general this is because we
would do a separate compile of the libomptarget device runtime and then
link in that cubin. This exercised the runtime in a lot of ways it's not
used to, since doing things this way was hardly expected or tested. This
patch disables it only for the Nvidia non-LTO build so that we still get
the effect of `--liboimptarget-nvptx-bc-path` rather than ignoring it.
---
 openmp/libomptarget/test/lit.cfg | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openmp/libomptarget/test/lit.cfg b/openmp/libomptarget/test/lit.cfg
index 80a3c10d3a949f5..6dab31bd35a9f31 100644
--- a/openmp/libomptarget/test/lit.cfg
+++ b/openmp/libomptarget/test/lit.cfg
@@ -128,7 +128,8 @@ elif config.operating_system == 'Darwin':
     config.test_flags += " -Wl,-rpath," + config.library_dir
     config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
 else: # Unices
-    config.test_flags += " -nogpulib"
+    if config.libomptarget_current_target != "nvptx64-nvidia-cuda":
+        config.test_flags += " -nogpulib"
     config.test_flags += " -Wl,-rpath," + config.library_dir
     config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
     config.test_flags += " -Wl,-rpath," + config.llvm_lib_directory



More information about the Openmp-commits mailing list