[llvm-branch-commits] [libc] release/19.x: [libc] Fix leftover debug commandline argument (PR #100291)

2024-07-29 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 approved this pull request.


https://github.com/llvm/llvm-project/pull/100291
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] release/19.x: [libc] Fix leftover debug commandline argument (PR #100291)

2024-07-24 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 updated 
https://github.com/llvm/llvm-project/pull/100291

>From c3dfd23fd6bb167eb6be49a24aef14a0f5621d8d Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 21:35:09 -0500
Subject: [PATCH 1/2] [libc] Fix leftover debug commandline argument

Summary:
Fixes https://github.com/llvm/llvm-project/issues/100289

(cherry picked from commit 0420d2f97eac49af5e816b0e3f2a9135d1673168)
---
 libc/cmake/modules/LLVMLibCTestRules.cmake | 1 -
 libc/docs/configure.rst| 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake 
b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 18adbee0bc7ad..96eb065c4a672 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -651,7 +651,6 @@ function(add_libc_hermetic test_name)
 target_link_options(${fq_build_target_name} PRIVATE
   ${LIBC_COMPILE_OPTIONS_DEFAULT} -Wno-multi-gpu
   -mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto
-  "-Wl,-asdfasdfasdf"
   "-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0" -nostdlib -static
   "-Wl,-mllvm,-amdhsa-code-object-version=${LIBC_GPU_CODE_OBJECT_VERSION}")
   elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
diff --git a/libc/docs/configure.rst b/libc/docs/configure.rst
index 5c55e4ab0f181..b81922367d8b7 100644
--- a/libc/docs/configure.rst
+++ b/libc/docs/configure.rst
@@ -29,7 +29,7 @@ to learn about the defaults for your platform and target.
 - ``LIBC_CONF_ENABLE_STRONG_STACK_PROTECTOR``: Enable 
-fstack-protector-strong to defend against stack smashing attack.
 - ``LIBC_CONF_KEEP_FRAME_POINTER``: Keep frame pointer in functions for 
better debugging experience.
 * **"errno" options**
-- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, 
LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM.
+- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, 
LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, 
and LIBC_ERRNO_MODE_SYSTEM.
 * **"malloc" options**
 - ``LIBC_CONF_FREELIST_MALLOC_BUFFER_SIZE``: Default size for the 
constinit freelist buffer used for the freelist malloc implementation (default 
1o 1GB).
 * **"math" options**

>From 5cc1df8e0c418ab3b7af212804f2fddf3371b71c Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 22:04:47 -0500
Subject: [PATCH 2/2] Update libc/docs/configure.rst

---
 libc/docs/configure.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/docs/configure.rst b/libc/docs/configure.rst
index b81922367d8b7..5c55e4ab0f181 100644
--- a/libc/docs/configure.rst
+++ b/libc/docs/configure.rst
@@ -29,7 +29,7 @@ to learn about the defaults for your platform and target.
 - ``LIBC_CONF_ENABLE_STRONG_STACK_PROTECTOR``: Enable 
-fstack-protector-strong to defend against stack smashing attack.
 - ``LIBC_CONF_KEEP_FRAME_POINTER``: Keep frame pointer in functions for 
better debugging experience.
 * **"errno" options**
-- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, 
LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, 
and LIBC_ERRNO_MODE_SYSTEM.
+- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, 
LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM.
 * **"malloc" options**
 - ``LIBC_CONF_FREELIST_MALLOC_BUFFER_SIZE``: Default size for the 
constinit freelist buffer used for the freelist malloc implementation (default 
1o 1GB).
 * **"math" options**

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] release/19.x: [libc] Fix leftover debug commandline argument (PR #100291)

2024-07-23 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 updated 
https://github.com/llvm/llvm-project/pull/100291

>From c3dfd23fd6bb167eb6be49a24aef14a0f5621d8d Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 21:35:09 -0500
Subject: [PATCH 1/2] [libc] Fix leftover debug commandline argument

Summary:
Fixes https://github.com/llvm/llvm-project/issues/100289

(cherry picked from commit 0420d2f97eac49af5e816b0e3f2a9135d1673168)
---
 libc/cmake/modules/LLVMLibCTestRules.cmake | 1 -
 libc/docs/configure.rst| 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake 
b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 18adbee0bc7ad..96eb065c4a672 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -651,7 +651,6 @@ function(add_libc_hermetic test_name)
 target_link_options(${fq_build_target_name} PRIVATE
   ${LIBC_COMPILE_OPTIONS_DEFAULT} -Wno-multi-gpu
   -mcpu=${LIBC_GPU_TARGET_ARCHITECTURE} -flto
-  "-Wl,-asdfasdfasdf"
   "-Wl,-mllvm,-amdgpu-lower-global-ctor-dtor=0" -nostdlib -static
   "-Wl,-mllvm,-amdhsa-code-object-version=${LIBC_GPU_CODE_OBJECT_VERSION}")
   elseif(LIBC_TARGET_ARCHITECTURE_IS_NVPTX)
diff --git a/libc/docs/configure.rst b/libc/docs/configure.rst
index 5c55e4ab0f181..b81922367d8b7 100644
--- a/libc/docs/configure.rst
+++ b/libc/docs/configure.rst
@@ -29,7 +29,7 @@ to learn about the defaults for your platform and target.
 - ``LIBC_CONF_ENABLE_STRONG_STACK_PROTECTOR``: Enable 
-fstack-protector-strong to defend against stack smashing attack.
 - ``LIBC_CONF_KEEP_FRAME_POINTER``: Keep frame pointer in functions for 
better debugging experience.
 * **"errno" options**
-- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, 
LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM.
+- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, 
LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, 
and LIBC_ERRNO_MODE_SYSTEM.
 * **"malloc" options**
 - ``LIBC_CONF_FREELIST_MALLOC_BUFFER_SIZE``: Default size for the 
constinit freelist buffer used for the freelist malloc implementation (default 
1o 1GB).
 * **"math" options**

>From 5cc1df8e0c418ab3b7af212804f2fddf3371b71c Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 22:04:47 -0500
Subject: [PATCH 2/2] Update libc/docs/configure.rst

---
 libc/docs/configure.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/docs/configure.rst b/libc/docs/configure.rst
index b81922367d8b7..5c55e4ab0f181 100644
--- a/libc/docs/configure.rst
+++ b/libc/docs/configure.rst
@@ -29,7 +29,7 @@ to learn about the defaults for your platform and target.
 - ``LIBC_CONF_ENABLE_STRONG_STACK_PROTECTOR``: Enable 
-fstack-protector-strong to defend against stack smashing attack.
 - ``LIBC_CONF_KEEP_FRAME_POINTER``: Keep frame pointer in functions for 
better debugging experience.
 * **"errno" options**
-- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, 
LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, 
and LIBC_ERRNO_MODE_SYSTEM.
+- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, 
LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM.
 * **"malloc" options**
 - ``LIBC_CONF_FREELIST_MALLOC_BUFFER_SIZE``: Default size for the 
constinit freelist buffer used for the freelist malloc implementation (default 
1o 1GB).
 * **"math" options**

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] release/19.x: [libc] Fix leftover debug commandline argument (PR #100291)

2024-07-23 Thread Joseph Huber via llvm-branch-commits


@@ -29,7 +29,7 @@ to learn about the defaults for your platform and target.
 - ``LIBC_CONF_ENABLE_STRONG_STACK_PROTECTOR``: Enable 
-fstack-protector-strong to defend against stack smashing attack.
 - ``LIBC_CONF_KEEP_FRAME_POINTER``: Keep frame pointer in functions for 
better debugging experience.
 * **"errno" options**
-- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, 
LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM.
+- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, 
LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, 
and LIBC_ERRNO_MODE_SYSTEM.

jhuber6 wrote:

```suggestion
- ``LIBC_CONF_ERRNO_MODE``: The implementation used for errno, acceptable 
values are LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, 
LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM.
```

https://github.com/llvm/llvm-project/pull/100291
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 updated 
https://github.com/llvm/llvm-project/pull/100216

>From d7f99606094fc1feb41b50de0b0eb6d07460 Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 14:41:57 -0500
Subject: [PATCH 1/5] [Clang] Correctly forward `--cuda-path` to the nvlink
 wrapper (#100170)

Summary:
This was not forwarded properly as it would try to pass it to `nvlink`.

Fixes https://github.com/llvm/llvm-project/issues/100168

(cherry picked from commit 7e1fcf5dd657d465c3fc846f56c6f9d3a4560b43)
---
 clang/lib/Driver/ToolChains/Cuda.cpp   |  4 
 clang/test/Driver/linker-wrapper-passes.c  | 10 +++---
 clang/test/Driver/nvlink-wrapper.c |  7 +++
 clang/tools/clang-nvlink-wrapper/NVLinkOpts.td |  4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp 
b/clang/lib/Driver/ToolChains/Cuda.cpp
index 59453c484ae4f..61d12b10dfb62 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -609,6 +609,10 @@ void NVPTX::Linker::ConstructJob(Compilation , const 
JobAction ,
 CmdArgs.push_back(Args.MakeArgString(
 "--pxtas-path=" + Args.getLastArgValue(options::OPT_ptxas_path_EQ)));
 
+  if (Args.hasArg(options::OPT_cuda_path_EQ))
+CmdArgs.push_back(Args.MakeArgString(
+"--cuda-path=" + Args.getLastArgValue(options::OPT_cuda_path_EQ)));
+
   // Add paths specified in LIBRARY_PATH environment variable as -L options.
   addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
 
diff --git a/clang/test/Driver/linker-wrapper-passes.c 
b/clang/test/Driver/linker-wrapper-passes.c
index aadcf472e9b63..8c337ff906d17 100644
--- a/clang/test/Driver/linker-wrapper-passes.c
+++ b/clang/test/Driver/linker-wrapper-passes.c
@@ -1,9 +1,5 @@
 // Check various clang-linker-wrapper pass options after -offload-opt.
 
-// REQUIRES: llvm-plugins, llvm-examples
-// REQUIRES: x86-registered-target
-// REQUIRES: amdgpu-registered-target
-
 // Setup.
 // RUN: mkdir -p %t
 // RUN: %clang -cc1 -emit-llvm-bc -o %t/host-x86_64-unknown-linux-gnu.bc \
@@ -23,14 +19,14 @@
 // RUN: %t/host-x86_64-unknown-linux-gnu.s
 
 // Check plugin, -passes, and no remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=OUT %s
 
 // Check plugin, -p, and remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-p="function(goodbye),module(inline)" \
@@ -43,7 +39,7 @@
 // RUN: -check-prefixes=YML %s
 
 // Check handling of bad plugin.
-// RUN: not clang-linker-wrapper \
+// RUN: not clang-linker-wrapper --dry-run \
 // RUN: --offload-opt=-load-pass-plugin=%t/nonexistent.so 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=BAD-PLUGIN %s
 
diff --git a/clang/test/Driver/nvlink-wrapper.c 
b/clang/test/Driver/nvlink-wrapper.c
index fdda93f1f9cdc..318315ddaca34 100644
--- a/clang/test/Driver/nvlink-wrapper.c
+++ b/clang/test/Driver/nvlink-wrapper.c
@@ -63,3 +63,10 @@ int baz() { return y + x; }
 // RUN:   -arch sm_52 -o a.out 2>&1 | FileCheck %s --check-prefix=LTO
 // LTO: ptxas{{.*}} -m64 -c [[PTX:.+]].s -O3 -arch sm_52 -o [[CUBIN:.+]].cubin
 // LTO: nvlink{{.*}} -arch sm_52 -o a.out [[CUBIN]].cubin 
{{.*}}-u-{{.*}}.cubin {{.*}}-y-{{.*}}.cubin
+
+//
+// Check that we don't forward some arguments.
+//
+// RUN: clang-nvlink-wrapper --dry-run %t.o %t-u.o %t-y.a \
+// RUN:   -arch sm_52 --cuda-path/opt/cuda -o a.out 2>&1 | FileCheck %s 
--check-prefix=PATH
+// PATH-NOT: --cuda-path=/opt/cuda
diff --git a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td 
b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
index e84b530f2787d..8c80a51b12a44 100644
--- a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
+++ b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
@@ -12,9 +12,9 @@ def verbose : Flag<["-"], "v">, HelpText<"Print verbose 
information">;
 def version : Flag<["--"], "version">,
   HelpText<"Display the version number and exit">;
 
-def cuda_path_EQ : Joined<["--"], "cuda-path=">,
+def cuda_path_EQ : Joined<["--"], "cuda-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the system CUDA path">;
-def ptxas_path_EQ : Joined<["--"], "ptxas-path=">,
+def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the 'ptxas' path">;
 
 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"">,

>From e9ac0f0e5916236cb091179cfa7befd081b01355 Mon 

[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 updated 
https://github.com/llvm/llvm-project/pull/100216

>From d7f99606094fc1feb41b50de0b0eb6d07460 Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 14:41:57 -0500
Subject: [PATCH 1/4] [Clang] Correctly forward `--cuda-path` to the nvlink
 wrapper (#100170)

Summary:
This was not forwarded properly as it would try to pass it to `nvlink`.

Fixes https://github.com/llvm/llvm-project/issues/100168

(cherry picked from commit 7e1fcf5dd657d465c3fc846f56c6f9d3a4560b43)
---
 clang/lib/Driver/ToolChains/Cuda.cpp   |  4 
 clang/test/Driver/linker-wrapper-passes.c  | 10 +++---
 clang/test/Driver/nvlink-wrapper.c |  7 +++
 clang/tools/clang-nvlink-wrapper/NVLinkOpts.td |  4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp 
b/clang/lib/Driver/ToolChains/Cuda.cpp
index 59453c484ae4f..61d12b10dfb62 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -609,6 +609,10 @@ void NVPTX::Linker::ConstructJob(Compilation , const 
JobAction ,
 CmdArgs.push_back(Args.MakeArgString(
 "--pxtas-path=" + Args.getLastArgValue(options::OPT_ptxas_path_EQ)));
 
+  if (Args.hasArg(options::OPT_cuda_path_EQ))
+CmdArgs.push_back(Args.MakeArgString(
+"--cuda-path=" + Args.getLastArgValue(options::OPT_cuda_path_EQ)));
+
   // Add paths specified in LIBRARY_PATH environment variable as -L options.
   addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
 
diff --git a/clang/test/Driver/linker-wrapper-passes.c 
b/clang/test/Driver/linker-wrapper-passes.c
index aadcf472e9b63..8c337ff906d17 100644
--- a/clang/test/Driver/linker-wrapper-passes.c
+++ b/clang/test/Driver/linker-wrapper-passes.c
@@ -1,9 +1,5 @@
 // Check various clang-linker-wrapper pass options after -offload-opt.
 
-// REQUIRES: llvm-plugins, llvm-examples
-// REQUIRES: x86-registered-target
-// REQUIRES: amdgpu-registered-target
-
 // Setup.
 // RUN: mkdir -p %t
 // RUN: %clang -cc1 -emit-llvm-bc -o %t/host-x86_64-unknown-linux-gnu.bc \
@@ -23,14 +19,14 @@
 // RUN: %t/host-x86_64-unknown-linux-gnu.s
 
 // Check plugin, -passes, and no remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=OUT %s
 
 // Check plugin, -p, and remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-p="function(goodbye),module(inline)" \
@@ -43,7 +39,7 @@
 // RUN: -check-prefixes=YML %s
 
 // Check handling of bad plugin.
-// RUN: not clang-linker-wrapper \
+// RUN: not clang-linker-wrapper --dry-run \
 // RUN: --offload-opt=-load-pass-plugin=%t/nonexistent.so 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=BAD-PLUGIN %s
 
diff --git a/clang/test/Driver/nvlink-wrapper.c 
b/clang/test/Driver/nvlink-wrapper.c
index fdda93f1f9cdc..318315ddaca34 100644
--- a/clang/test/Driver/nvlink-wrapper.c
+++ b/clang/test/Driver/nvlink-wrapper.c
@@ -63,3 +63,10 @@ int baz() { return y + x; }
 // RUN:   -arch sm_52 -o a.out 2>&1 | FileCheck %s --check-prefix=LTO
 // LTO: ptxas{{.*}} -m64 -c [[PTX:.+]].s -O3 -arch sm_52 -o [[CUBIN:.+]].cubin
 // LTO: nvlink{{.*}} -arch sm_52 -o a.out [[CUBIN]].cubin 
{{.*}}-u-{{.*}}.cubin {{.*}}-y-{{.*}}.cubin
+
+//
+// Check that we don't forward some arguments.
+//
+// RUN: clang-nvlink-wrapper --dry-run %t.o %t-u.o %t-y.a \
+// RUN:   -arch sm_52 --cuda-path/opt/cuda -o a.out 2>&1 | FileCheck %s 
--check-prefix=PATH
+// PATH-NOT: --cuda-path=/opt/cuda
diff --git a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td 
b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
index e84b530f2787d..8c80a51b12a44 100644
--- a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
+++ b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
@@ -12,9 +12,9 @@ def verbose : Flag<["-"], "v">, HelpText<"Print verbose 
information">;
 def version : Flag<["--"], "version">,
   HelpText<"Display the version number and exit">;
 
-def cuda_path_EQ : Joined<["--"], "cuda-path=">,
+def cuda_path_EQ : Joined<["--"], "cuda-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the system CUDA path">;
-def ptxas_path_EQ : Joined<["--"], "ptxas-path=">,
+def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the 'ptxas' path">;
 
 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"">,

>From e9ac0f0e5916236cb091179cfa7befd081b01355 Mon 

[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 updated 
https://github.com/llvm/llvm-project/pull/100216

>From d7f99606094fc1feb41b50de0b0eb6d07460 Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 14:41:57 -0500
Subject: [PATCH 1/3] [Clang] Correctly forward `--cuda-path` to the nvlink
 wrapper (#100170)

Summary:
This was not forwarded properly as it would try to pass it to `nvlink`.

Fixes https://github.com/llvm/llvm-project/issues/100168

(cherry picked from commit 7e1fcf5dd657d465c3fc846f56c6f9d3a4560b43)
---
 clang/lib/Driver/ToolChains/Cuda.cpp   |  4 
 clang/test/Driver/linker-wrapper-passes.c  | 10 +++---
 clang/test/Driver/nvlink-wrapper.c |  7 +++
 clang/tools/clang-nvlink-wrapper/NVLinkOpts.td |  4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp 
b/clang/lib/Driver/ToolChains/Cuda.cpp
index 59453c484ae4f..61d12b10dfb62 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -609,6 +609,10 @@ void NVPTX::Linker::ConstructJob(Compilation , const 
JobAction ,
 CmdArgs.push_back(Args.MakeArgString(
 "--pxtas-path=" + Args.getLastArgValue(options::OPT_ptxas_path_EQ)));
 
+  if (Args.hasArg(options::OPT_cuda_path_EQ))
+CmdArgs.push_back(Args.MakeArgString(
+"--cuda-path=" + Args.getLastArgValue(options::OPT_cuda_path_EQ)));
+
   // Add paths specified in LIBRARY_PATH environment variable as -L options.
   addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
 
diff --git a/clang/test/Driver/linker-wrapper-passes.c 
b/clang/test/Driver/linker-wrapper-passes.c
index aadcf472e9b63..8c337ff906d17 100644
--- a/clang/test/Driver/linker-wrapper-passes.c
+++ b/clang/test/Driver/linker-wrapper-passes.c
@@ -1,9 +1,5 @@
 // Check various clang-linker-wrapper pass options after -offload-opt.
 
-// REQUIRES: llvm-plugins, llvm-examples
-// REQUIRES: x86-registered-target
-// REQUIRES: amdgpu-registered-target
-
 // Setup.
 // RUN: mkdir -p %t
 // RUN: %clang -cc1 -emit-llvm-bc -o %t/host-x86_64-unknown-linux-gnu.bc \
@@ -23,14 +19,14 @@
 // RUN: %t/host-x86_64-unknown-linux-gnu.s
 
 // Check plugin, -passes, and no remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=OUT %s
 
 // Check plugin, -p, and remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-p="function(goodbye),module(inline)" \
@@ -43,7 +39,7 @@
 // RUN: -check-prefixes=YML %s
 
 // Check handling of bad plugin.
-// RUN: not clang-linker-wrapper \
+// RUN: not clang-linker-wrapper --dry-run \
 // RUN: --offload-opt=-load-pass-plugin=%t/nonexistent.so 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=BAD-PLUGIN %s
 
diff --git a/clang/test/Driver/nvlink-wrapper.c 
b/clang/test/Driver/nvlink-wrapper.c
index fdda93f1f9cdc..318315ddaca34 100644
--- a/clang/test/Driver/nvlink-wrapper.c
+++ b/clang/test/Driver/nvlink-wrapper.c
@@ -63,3 +63,10 @@ int baz() { return y + x; }
 // RUN:   -arch sm_52 -o a.out 2>&1 | FileCheck %s --check-prefix=LTO
 // LTO: ptxas{{.*}} -m64 -c [[PTX:.+]].s -O3 -arch sm_52 -o [[CUBIN:.+]].cubin
 // LTO: nvlink{{.*}} -arch sm_52 -o a.out [[CUBIN]].cubin 
{{.*}}-u-{{.*}}.cubin {{.*}}-y-{{.*}}.cubin
+
+//
+// Check that we don't forward some arguments.
+//
+// RUN: clang-nvlink-wrapper --dry-run %t.o %t-u.o %t-y.a \
+// RUN:   -arch sm_52 --cuda-path/opt/cuda -o a.out 2>&1 | FileCheck %s 
--check-prefix=PATH
+// PATH-NOT: --cuda-path=/opt/cuda
diff --git a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td 
b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
index e84b530f2787d..8c80a51b12a44 100644
--- a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
+++ b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
@@ -12,9 +12,9 @@ def verbose : Flag<["-"], "v">, HelpText<"Print verbose 
information">;
 def version : Flag<["--"], "version">,
   HelpText<"Display the version number and exit">;
 
-def cuda_path_EQ : Joined<["--"], "cuda-path=">,
+def cuda_path_EQ : Joined<["--"], "cuda-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the system CUDA path">;
-def ptxas_path_EQ : Joined<["--"], "ptxas-path=">,
+def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the 'ptxas' path">;
 
 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"">,

>From e9ac0f0e5916236cb091179cfa7befd081b01355 Mon 

[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits


@@ -23,14 +22,14 @@
 // RUN: %t/host-x86_64-unknown-linux-gnu.s
 
 // Check plugin, -passes, and no remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=OUT %s
 
 // Check plugin, -p, and remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \

jhuber6 wrote:

```suggestion
// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
```

https://github.com/llvm/llvm-project/pull/100216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits


@@ -23,14 +22,14 @@
 // RUN: %t/host-x86_64-unknown-linux-gnu.s
 
 // Check plugin, -passes, and no remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \

jhuber6 wrote:

```suggestion
// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
```

https://github.com/llvm/llvm-project/pull/100216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits


@@ -43,7 +42,7 @@
 // RUN: -check-prefixes=YML %s
 
 // Check handling of bad plugin.
-// RUN: not clang-linker-wrapper \
+// RUN: not clang-linker-wrapper --dry-run \

jhuber6 wrote:

```suggestion
// RUN: not clang-linker-wrapper \
```

https://github.com/llvm/llvm-project/pull/100216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 updated 
https://github.com/llvm/llvm-project/pull/100216

>From d7f99606094fc1feb41b50de0b0eb6d07460 Mon Sep 17 00:00:00 2001
From: Joseph Huber 
Date: Tue, 23 Jul 2024 14:41:57 -0500
Subject: [PATCH 1/2] [Clang] Correctly forward `--cuda-path` to the nvlink
 wrapper (#100170)

Summary:
This was not forwarded properly as it would try to pass it to `nvlink`.

Fixes https://github.com/llvm/llvm-project/issues/100168

(cherry picked from commit 7e1fcf5dd657d465c3fc846f56c6f9d3a4560b43)
---
 clang/lib/Driver/ToolChains/Cuda.cpp   |  4 
 clang/test/Driver/linker-wrapper-passes.c  | 10 +++---
 clang/test/Driver/nvlink-wrapper.c |  7 +++
 clang/tools/clang-nvlink-wrapper/NVLinkOpts.td |  4 ++--
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp 
b/clang/lib/Driver/ToolChains/Cuda.cpp
index 59453c484ae4f..61d12b10dfb62 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -609,6 +609,10 @@ void NVPTX::Linker::ConstructJob(Compilation , const 
JobAction ,
 CmdArgs.push_back(Args.MakeArgString(
 "--pxtas-path=" + Args.getLastArgValue(options::OPT_ptxas_path_EQ)));
 
+  if (Args.hasArg(options::OPT_cuda_path_EQ))
+CmdArgs.push_back(Args.MakeArgString(
+"--cuda-path=" + Args.getLastArgValue(options::OPT_cuda_path_EQ)));
+
   // Add paths specified in LIBRARY_PATH environment variable as -L options.
   addDirectoryList(Args, CmdArgs, "-L", "LIBRARY_PATH");
 
diff --git a/clang/test/Driver/linker-wrapper-passes.c 
b/clang/test/Driver/linker-wrapper-passes.c
index aadcf472e9b63..8c337ff906d17 100644
--- a/clang/test/Driver/linker-wrapper-passes.c
+++ b/clang/test/Driver/linker-wrapper-passes.c
@@ -1,9 +1,5 @@
 // Check various clang-linker-wrapper pass options after -offload-opt.
 
-// REQUIRES: llvm-plugins, llvm-examples
-// REQUIRES: x86-registered-target
-// REQUIRES: amdgpu-registered-target
-
 // Setup.
 // RUN: mkdir -p %t
 // RUN: %clang -cc1 -emit-llvm-bc -o %t/host-x86_64-unknown-linux-gnu.bc \
@@ -23,14 +19,14 @@
 // RUN: %t/host-x86_64-unknown-linux-gnu.s
 
 // Check plugin, -passes, and no remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-passes="function(goodbye),module(inline)" 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=OUT %s
 
 // Check plugin, -p, and remarks.
-// RUN: clang-linker-wrapper -o a.out --embed-bitcode \
+// RUN: clang-linker-wrapper -o a.out --embed-bitcode --dry-run \
 // RUN: --linker-path=/usr/bin/true %t/host-x86_64-unknown-linux-gnu.o \
 // RUN: %offload-opt-loadbye --offload-opt=-wave-goodbye \
 // RUN: --offload-opt=-p="function(goodbye),module(inline)" \
@@ -43,7 +39,7 @@
 // RUN: -check-prefixes=YML %s
 
 // Check handling of bad plugin.
-// RUN: not clang-linker-wrapper \
+// RUN: not clang-linker-wrapper --dry-run \
 // RUN: --offload-opt=-load-pass-plugin=%t/nonexistent.so 2>&1 | \
 // RUN:   FileCheck -match-full-lines -check-prefixes=BAD-PLUGIN %s
 
diff --git a/clang/test/Driver/nvlink-wrapper.c 
b/clang/test/Driver/nvlink-wrapper.c
index fdda93f1f9cdc..318315ddaca34 100644
--- a/clang/test/Driver/nvlink-wrapper.c
+++ b/clang/test/Driver/nvlink-wrapper.c
@@ -63,3 +63,10 @@ int baz() { return y + x; }
 // RUN:   -arch sm_52 -o a.out 2>&1 | FileCheck %s --check-prefix=LTO
 // LTO: ptxas{{.*}} -m64 -c [[PTX:.+]].s -O3 -arch sm_52 -o [[CUBIN:.+]].cubin
 // LTO: nvlink{{.*}} -arch sm_52 -o a.out [[CUBIN]].cubin 
{{.*}}-u-{{.*}}.cubin {{.*}}-y-{{.*}}.cubin
+
+//
+// Check that we don't forward some arguments.
+//
+// RUN: clang-nvlink-wrapper --dry-run %t.o %t-u.o %t-y.a \
+// RUN:   -arch sm_52 --cuda-path/opt/cuda -o a.out 2>&1 | FileCheck %s 
--check-prefix=PATH
+// PATH-NOT: --cuda-path=/opt/cuda
diff --git a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td 
b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
index e84b530f2787d..8c80a51b12a44 100644
--- a/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
+++ b/clang/tools/clang-nvlink-wrapper/NVLinkOpts.td
@@ -12,9 +12,9 @@ def verbose : Flag<["-"], "v">, HelpText<"Print verbose 
information">;
 def version : Flag<["--"], "version">,
   HelpText<"Display the version number and exit">;
 
-def cuda_path_EQ : Joined<["--"], "cuda-path=">,
+def cuda_path_EQ : Joined<["--"], "cuda-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the system CUDA path">;
-def ptxas_path_EQ : Joined<["--"], "ptxas-path=">,
+def ptxas_path_EQ : Joined<["--"], "ptxas-path=">, Flags<[WrapperOnlyOption]>,
   MetaVarName<"">, HelpText<"Set the 'ptxas' path">;
 
 def o : JoinedOrSeparate<["-"], "o">, MetaVarName<"">,

>From e9ac0f0e5916236cb091179cfa7befd081b01355 Mon 

[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 edited 
https://github.com/llvm/llvm-project/pull/100216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] release/19.x: [Clang] Correctly forward `--cuda-path` to the nvlink wrapper (#100170) (PR #100216)

2024-07-23 Thread Joseph Huber via llvm-branch-commits


@@ -1,9 +1,5 @@
 // Check various clang-linker-wrapper pass options after -offload-opt.
 

jhuber6 wrote:

```suggestion
// REQUIRES: llvm-plugins, llvm-examples
// REQUIRES: x86-registered-target
// REQUIRES: amdgpu-registered-target
```

https://github.com/llvm/llvm-project/pull/100216
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] [llvm] release/19.x: [NVPTX] Fix internal indirect call prototypes not obeying the ABI (#100131) (PR #100174)

2024-07-23 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

This should be merged

https://github.com/llvm/llvm-project/pull/100174
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

2024-06-17 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 closed 
https://github.com/llvm/llvm-project/pull/95484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

2024-06-17 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

I merged my patch, I think the window to backport to 18.x is passed so you'll 
need to use the main branch for now. Thanks for bringing this to my attention.

https://github.com/llvm/llvm-project/pull/95484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

2024-06-17 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

Made https://github.com/llvm/llvm-project/pull/95769, don't know if the window 
for the 18.x window is still open for a back port.

https://github.com/llvm/llvm-project/pull/95484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

2024-06-16 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

> This doesn't make sense, the ROCm packages may be just badly made by AMD.
> 
> When I temporarily remove `/usr/include/hsa` without uninstalling 
> `libhsa-runtime-dev` **AND** while using 
> `-DLIBOMPTARGET_FORCE_DLOPEN_LIBHSA=ON`, I can build LLVM18 without patch.
> 
> With `-DLIBOMPTARGET_FORCE_DLOPEN_LIBHSA=OFF` CMake complains that 
> `/usr/include/hsa` is missing.
> 
> So it looks like I'm tracking a ROCm packaging bug from AMD side.

I don't think AMD handles the actual packaging, that's on the maintainers for 
your distribution. I'm guessing that the HSA runtime is a separate package from 
ROCm and gets put somewhere else for whatever reason. I don't have any issues 
like that with my distribution.

> But I still don't get why LLVM doesn't use its own HSA by default and doesn't 
> use its own headers for enum values used in its own code.

It does in the main branch, but I think you're right that the logic causes it 
to look at the system one first since `hsa/hsa.h` is higher up the search list. 
Should probably do something about that.

https://github.com/llvm/llvm-project/pull/95484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

2024-06-14 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

> The `openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp` file requires 
> the `HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY` symbol.
> 
> This symbol is expected to be provided by 
> `openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa_ext_amd.h`, not 
> by third-party external `/opt/rocm/include/hsa/hsa_ext_amd.h`.

This was introduced in ROCm-5.3, see 
https://github.com/ROCm/ROCR-Runtime/blob/rocm-5.3.x/src/inc/hsa_ext_amd.h#L333.
 The `dynamic_hsa/` version is a copy of this header for use when the system 
version is not provided. If the system fails to find HSA, then it will use the 
dynamic version. The problem here is that you _have_ HSA, but it's too old. I 
don't know how much backward compatibility we really provide here, 
unfortunately the HSA headers really don't give you much versioning to work 
with, so we can't do `ifdef` on this stuff. 

https://github.com/llvm/llvm-project/pull/95484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

2024-06-13 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 edited 
https://github.com/llvm/llvm-project/pull/95484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP][OMPT] Fix hsa include when building amdgpu/src/rtl.cpp (PR #95484)

2024-06-13 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 commented:

We made a change recently that made the dynamic_hsa version the default. The 
error you're seeing is from an old HSA, so if you're overriding the default to 
use an old library that's probably not worth working around.

https://github.com/llvm/llvm-project/pull/95484
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)

2024-05-21 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 approved this pull request.


https://github.com/llvm/llvm-project/pull/89755
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [pstl] Revise IDE folder structure (PR #89755)

2024-05-21 Thread Joseph Huber via llvm-branch-commits


@@ -9,6 +9,7 @@ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
 include(${LLVM_COMMON_CMAKE_UTILS}/Modules/LLVMVersion.cmake)
 
 project(Runtimes C CXX ASM)
+set(LLVM_SUBPROJECT_TITLE "Runtimes")

jhuber6 wrote:

Is this needed? My understanding is that the runtimes CMake here is the root 
that includes all the other projects, so this doesn't actually contain any 
"projects'>

https://github.com/llvm/llvm-project/pull/89755
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP] Fix child processes to use affinity_none (#91391) (PR #91479)

2024-05-10 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

> @jhuber6 What do you think about merging this PR to the release branch?

This PR should be merged.

> @jhuber6 , Sorry, I'm not used to backporting. Are you the right person for 
> this?

AFAIK the bot asking is automated and then a human pushes the button.

https://github.com/llvm/llvm-project/pull/91479
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [RISCV] Support llvm.readsteadycounter intrinsic (PR #82322)

2024-02-20 Thread Joseph Huber via llvm-branch-commits

https://github.com/jhuber6 approved this pull request.


https://github.com/llvm/llvm-project/pull/82322
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] release/18.x: [OpenMP] [cmake] Don't use -fno-semantic-interposition on Windows (#81113) (PR #81332)

2024-02-15 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

Sure, LG

https://github.com/llvm/llvm-project/pull/81332
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] PR for llvm/llvm-project#80117 (PR #80291)

2024-02-01 Thread Joseph Huber via llvm-branch-commits

jhuber6 wrote:

Merge

https://github.com/llvm/llvm-project/pull/80291
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] a957634 - [OpenMP] Add documentation for error messages and release notes

2021-01-13 Thread Joseph Huber via llvm-branch-commits

Author: Joseph Huber
Date: 2021-01-13T11:00:41-05:00
New Revision: a957634942a48c963a8ed99b1bb90f7b985a3602

URL: 
https://github.com/llvm/llvm-project/commit/a957634942a48c963a8ed99b1bb90f7b985a3602
DIFF: 
https://github.com/llvm/llvm-project/commit/a957634942a48c963a8ed99b1bb90f7b985a3602.diff

LOG: [OpenMP] Add documentation for error messages and release notes

Add extra information to the runtime page describing the error messages and add 
information to the release notes for clang 12.0

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D94562

Added: 


Modified: 
openmp/docs/ReleaseNotes.rst
openmp/docs/design/Runtimes.rst

Removed: 




diff  --git a/openmp/docs/ReleaseNotes.rst b/openmp/docs/ReleaseNotes.rst
index de0f2018032c..7f40d3c81510 100644
--- a/openmp/docs/ReleaseNotes.rst
+++ b/openmp/docs/ReleaseNotes.rst
@@ -13,11 +13,34 @@ Introduction
 
 
 This document contains the release notes for the OpenMP runtime, release 
12.0.0.
-Here we describe the status of openmp, including major improvements
-from the previous release. All openmp releases may be downloaded
+Here we describe the status of OpenMP, including major improvements
+from the previous release. All OpenMP releases may be downloaded
 from the `LLVM releases web site `_.
 
 Non-comprehensive list of changes in this release
 =
 
+- Extended the ``libomptarget`` API functions to include source location
+  information and OpenMP target mapper support. This allows ``libomptarget`` to
+  know the source location of the OpenMP region it is executing, as well as the
+  name and declarations of all the variables used inside the region. Each
+  function generated now uses its ``mapper`` variant. The old API calls now 
call
+  into the new API functions with ``nullptr`` arguments for backwards
+  compatibility with old binaries. Source location information for
+  ``libomptarget`` is now generated by Clang at any level of debugging
+  information.
 
+- Added improved error messages for ``libomptarget`` and ``CUDA`` plugins. 
Error
+  messages are now presented without requiring a debug build of
+  ``libomptarget``. The newly added source location information can also be 
used
+  to identify which OpenMP target region the failure occurred in. More
+  information can be found :ref:`here `.
+
+- Added additional environment variables to control output from the
+  ``libomptarget`` runtime library. ``LIBOMPTARGET_PROFILE`` to
+  generate time profile output similar to Clang's ``-ftime-trace`` option.
+  ``LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD`` sets the threshold size for which
+  the ``libomptarget`` memory manager will handle the allocation.
+  ``LIBOMPTARGET_INFO`` allows the user to request certain information from the
+  ``libomptarget`` runtime using a 32-bit field. A full description of each
+  environment variable is described :ref:`here 
`.

diff  --git a/openmp/docs/design/Runtimes.rst b/openmp/docs/design/Runtimes.rst
index 1d52b6b8378c..85031c66f442 100644
--- a/openmp/docs/design/Runtimes.rst
+++ b/openmp/docs/design/Runtimes.rst
@@ -16,6 +16,8 @@ the LLVM/OpenMP host runtime, aka.  `libomp.so`, is available 
as a `pdf
 LLVM/OpenMP Target Host Runtime (``libomptarget``)
 --
 
+.. _libopenmptarget_environment_vars:
+
 Environment Variables
 ^
 
@@ -171,6 +173,95 @@ shows that ``D`` will be copied back from the device once 
the OpenMP device
 kernel region ends even though it isn't written to. Finally, at the end of the
 OpenMP data region the entries for ``X`` and ``Y`` are removed from the table.
 
+.. _libopenmptarget_errors:
+
+Errors:
+^^^
+
+``libomptarget`` provides error messages when the program fails inside the
+OpenMP target region. Common causes of failure could be an invalid pointer
+access, running out of device memory, or trying to offload when the device is
+busy. If the application was built with debugging symbols the error messages
+will additionally provide the source location of the OpenMP target region.
+
+For example, consider the following code that implements a simple parallel
+reduction on the GPU. This code has a bug that causes it to fail in the
+offloading region.
+
+.. code-block:: c++
+
+#include 
+
+double sum(double *A, std::size_t N) {
+  double sum = 0.0;
+#pragma omp target teams distribute parallel for reduction(+:sum)
+  for (int i = 0; i < N; ++i)
+sum += A[i];
+
+  return sum;
+}
+
+int main() {
+  const int N = 1024;
+  double A[N];
+  sum(A, N);
+}
+
+If this code is compiled and run, there will be an error message indicating 
what is
+going wrong.
+
+.. code-block:: console
+
+$ clang++ -fopenmp -fopenmp-targets=nvptx64 -O3 -gline-tables-only sum.cpp 
-o 

[llvm-branch-commits] [openmp] abb174b - [OpenMP] Add example in Libomptarget Information docs

2021-01-07 Thread Joseph Huber via llvm-branch-commits

Author: Joseph Huber
Date: 2021-01-07T15:00:51-05:00
New Revision: abb174bbc100437556fd386d920a9939723e0647

URL: 
https://github.com/llvm/llvm-project/commit/abb174bbc100437556fd386d920a9939723e0647
DIFF: 
https://github.com/llvm/llvm-project/commit/abb174bbc100437556fd386d920a9939723e0647.diff

LOG: [OpenMP] Add example in Libomptarget Information docs

Add an example to the OpenMP Documentation on the LIBOMPTARGET_INFO environment 
variable

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D94246

Added: 


Modified: 
openmp/docs/design/Runtimes.rst

Removed: 




diff  --git a/openmp/docs/design/Runtimes.rst b/openmp/docs/design/Runtimes.rst
index c9f3a55c0067..1d52b6b8378c 100644
--- a/openmp/docs/design/Runtimes.rst
+++ b/openmp/docs/design/Runtimes.rst
@@ -98,6 +98,85 @@ Or, to enable every flag run with every bit set.
 
$ env LIBOMPTARGET_INFO=-1 ./your-application
 
+For example, given a small application implementing the ``ZAXPY`` BLAS routine,
+``Libomptarget`` can provide useful information about data mappings and thread
+usages.
+
+.. code-block:: c++
+
+#include 
+
+using complex = std::complex;
+
+void zaxpy(complex *X, complex *Y, complex D, std::size_t N) {
+#pragma omp target teams distribute parallel for
+  for (std::size_t i = 0; i < N; ++i)
+Y[i] = D * X[i] + Y[i];
+}
+
+int main() {
+  const std::size_t N = 1024;
+  complex X[N], Y[N], D;
+#pragma omp target data map(to:X[0 : N]) map(tofrom:Y[0 : N])
+  zaxpy(X, Y, D, N);
+}
+
+Compiling this code targeting ``nvptx64`` with all information enabled will
+provide the following output from the runtime library.
+
+.. code-block:: console
+
+$ clang++ -fopenmp -fopenmp-targets=nvptx64 -O3 -gline-tables-only 
zaxpy.cpp -o zaxpy
+$ env LIBOMPTARGET_INFO=-1 ./zaxpy
+
+.. code-block:: text
+
+Info: Device supports up to 65536 CUDA blocks and 1024 threads with a warp 
size of 32
+Info: Entering OpenMP data region at zaxpy.cpp:14:1 with 2 arguments:
+Info: to(X[0:N])[16384] 
+Info: tofrom(Y[0:N])[16384] 
+Info: OpenMP Host-Device pointer mappings after block at zaxpy.cpp:14:1:
+Info: Host Ptr   Target Ptr Size (B) RefCount Declaration
+Info: 0x7fff963f4000 0x7fd225004000 163841Y[0:N] at 
zaxpy.cpp:13:17
+Info: 0x7fff963f8000 0x7fd22500 163841X[0:N] at 
zaxpy.cpp:13:11
+Info: Entering OpenMP kernel at zaxpy.cpp:6:1 with 4 arguments:
+Info: firstprivate(N)[8] (implicit)
+Info: use_address(Y)[0] (implicit)
+Info: tofrom(D)[16] (implicit)
+Info: use_address(X)[0] (implicit)
+Info: Mapping exists (implicit) with HstPtrBegin=0x7ffe37d8be80, 
+  TgtPtrBegin=0x7f90ff004000, Size=0, updated RefCount=2, Name=Y
+Info: Mapping exists (implicit) with HstPtrBegin=0x7ffe37d8fe80, 
+  TgtPtrBegin=0x7f90ff00, Size=0, updated RefCount=2, Name=X
+Info: Launching kernel 
__omp_offloading_fd02_c2c4ac1a__Z5daxpyPNSt3__17complexIdEES2_S1_m_l6
+  with 8 blocks and 128 threads in SPMD mode
+Info: OpenMP Host-Device pointer mappings after block at zaxpy.cpp:6:1:
+Info: Host Ptr   Target Ptr Size (B) RefCount Declaration
+Info: 0x7fff963f4000 0x7fd225004000 163841Y[0:N] at 
zaxpy.cpp:13:17
+Info: 0x7fff963f8000 0x7fd22500 163841X[0:N] at 
zaxpy.cpp:13:11
+Info: Exiting OpenMP data region at zaxpy.cpp:14:1 with 2 arguments:
+Info: to(X[0:N])[16384] 
+Info: tofrom(Y[0:N])[16384] 
+
+From this information, we can see the OpenMP kernel being launched on the CUDA
+device with enough threads and blocks for all ``1024`` iterations of the loop 
in
+simplified :doc:`SPMD Mode `. The information from the OpenMP data
+region shows the two arrays ``X`` and ``Y`` being copied from the host to the
+device. This creates an entry in the host-device mapping table associating the
+host pointers to the newly created device data. The data mappings in the OpenMP
+device kernel show the default mappings being used for all the variables used
+implicitly on the device. Because ``X`` and ``Y`` are already mapped in the
+device's table, no new entries are created. Additionally, the default mapping
+shows that ``D`` will be copied back from the device once the OpenMP device
+kernel region ends even though it isn't written to. Finally, at the end of the
+OpenMP data region the entries for ``X`` and ``Y`` are removed from the table.
+
+.. toctree::
+   :hidden:
+   :maxdepth: 1
+
+   Offloading
+
 LLVM/OpenMP Target Host Runtime Plugins (``libomptarget.rtl.``)
 ---
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org

[llvm-branch-commits] [openmp] 631501b - [OpenMP] Fixing typo on memory size in Documenation

2020-12-23 Thread Joseph Huber via llvm-branch-commits

Author: Joseph Huber
Date: 2020-12-23T11:46:26-05:00
New Revision: 631501b1f90e8a90faeadbd535a557633a5af71b

URL: 
https://github.com/llvm/llvm-project/commit/631501b1f90e8a90faeadbd535a557633a5af71b
DIFF: 
https://github.com/llvm/llvm-project/commit/631501b1f90e8a90faeadbd535a557633a5af71b.diff

LOG: [OpenMP] Fixing typo on memory size in Documenation

Added: 


Modified: 
openmp/docs/design/Runtimes.rst

Removed: 




diff  --git a/openmp/docs/design/Runtimes.rst b/openmp/docs/design/Runtimes.rst
index 2e5f2bfe0384..c9f3a55c0067 100644
--- a/openmp/docs/design/Runtimes.rst
+++ b/openmp/docs/design/Runtimes.rst
@@ -60,7 +60,7 @@ LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD
 ``LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD`` sets the threshold size for which the
 ``libomptarget`` memory manager will handle the allocation. Any allocations
 larger than this threshold will not use the memory manager and be freed after
-the device kernel exits The default threshold value is ``8Kb``. If
+the device kernel exits. The default threshold value is ``8KB``. If
 ``LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD`` is set to ``0`` the memory manager
 will be completely disabled.
 



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] 6e60346 - [OpenMP] Fixing Typo in Documentation

2020-12-23 Thread Joseph Huber via llvm-branch-commits

Author: Joseph Huber
Date: 2020-12-23T09:17:51-05:00
New Revision: 6e603464959d43e0e430d0f8ac5522b073d68ba1

URL: 
https://github.com/llvm/llvm-project/commit/6e603464959d43e0e430d0f8ac5522b073d68ba1
DIFF: 
https://github.com/llvm/llvm-project/commit/6e603464959d43e0e430d0f8ac5522b073d68ba1.diff

LOG: [OpenMP] Fixing Typo in Documentation

Added: 


Modified: 
openmp/docs/design/Runtimes.rst

Removed: 




diff  --git a/openmp/docs/design/Runtimes.rst b/openmp/docs/design/Runtimes.rst
index 39ed256c4856..2e5f2bfe0384 100644
--- a/openmp/docs/design/Runtimes.rst
+++ b/openmp/docs/design/Runtimes.rst
@@ -67,7 +67,7 @@ will be completely disabled.
 LIBOMPTARGET_INFO
 "
 
-``LIBOMPTARGET_INFO`` allows the user to request 
diff erent types runtime
+``LIBOMPTARGET_INFO`` allows the user to request 
diff erent types of runtime
 information from ``libomptarget``. ``LIBOMPTARGET_INFO`` uses a 32-bit field to
 enable or disable 
diff erent types of information. This includes information
 about data-mappings and kernel execution. It is recommended to build your



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [openmp] 1c19804 - [OpenMP] Add OpenMP Documentation for Libomptarget environment variables

2020-12-22 Thread Joseph Huber via llvm-branch-commits

Author: Joseph Huber
Date: 2020-12-22T17:41:27-05:00
New Revision: 1c19804ebf4c97666a5c7de86ca7432c6b020205

URL: 
https://github.com/llvm/llvm-project/commit/1c19804ebf4c97666a5c7de86ca7432c6b020205
DIFF: 
https://github.com/llvm/llvm-project/commit/1c19804ebf4c97666a5c7de86ca7432c6b020205.diff

LOG: [OpenMP] Add OpenMP Documentation for Libomptarget environment variables

Add support to the OpenMP web pages for environment variables supported
by Libomptarget and their usage.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D93723

Added: 


Modified: 
openmp/docs/design/Runtimes.rst

Removed: 




diff  --git a/openmp/docs/design/Runtimes.rst b/openmp/docs/design/Runtimes.rst
index 61491060ea04..39ed256c4856 100644
--- a/openmp/docs/design/Runtimes.rst
+++ b/openmp/docs/design/Runtimes.rst
@@ -16,6 +16,88 @@ the LLVM/OpenMP host runtime, aka.  `libomp.so`, is 
available as a `pdf
 LLVM/OpenMP Target Host Runtime (``libomptarget``)
 --
 
+Environment Variables
+^
+
+``libomptarget`` uses environment variables to control 
diff erent features of the
+library at runtime. This allows the user to obtain useful runtime information 
as
+well as enable or disable certain features. A full list of supported 
environment
+variables is defined below.
+
+* ``LIBOMPTARGET_DEBUG=``
+* ``LIBOMPTARGET_PROFILE=``
+* ``LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD=``
+* ``LIBOMPTARGET_INFO=``
+
+LIBOMPTARGET_DEBUG
+""
+
+``LIBOMPTARGET_DEBUG`` controls whether or not debugging information will be
+displayed. This feature is only availible if ``libomptarget`` was built with
+``-DOMPTARGET_DEBUG``. The debugging output provided is intended for use by
+``libomptarget`` developers. More user-friendly output is presented when using
+``LIBOMPTARGET_INFO``.
+
+LIBOMPTARGET_PROFILE
+
+``LIBOMPTARGET_PROFILE`` allows ``libomptarget`` to generate time profile 
output
+similar to Clang's ``-ftime-trace`` option. This generates a JSON file based on
+`Chrome Tracing`_ that can be viewed with ``chrome://tracing`` or the
+`Speedscope App`_. Building this feature depends on the `LLVM Support Library`_
+for time trace output. Using this library is enabled by default when building
+using the CMake option ``OPENMP_ENABLE_LIBOMPTARGET_PROFILING``. The output 
will
+be saved to the filename specified by the environment variable.
+
+.. _`Chrome Tracing`: 
https://www.chromium.org/developers/how-tos/trace-event-profiling-tool
+
+.. _`Speedscope App`: https://www.speedscope.app/
+
+.. _`LLVM Support Library`: https://llvm.org/docs/SupportLibrary.html
+
+LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD
+"
+
+``LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD`` sets the threshold size for which the
+``libomptarget`` memory manager will handle the allocation. Any allocations
+larger than this threshold will not use the memory manager and be freed after
+the device kernel exits The default threshold value is ``8Kb``. If
+``LIBOMPTARGET_MEMORY_MANAGER_THRESHOLD`` is set to ``0`` the memory manager
+will be completely disabled.
+
+LIBOMPTARGET_INFO
+"
+
+``LIBOMPTARGET_INFO`` allows the user to request 
diff erent types runtime
+information from ``libomptarget``. ``LIBOMPTARGET_INFO`` uses a 32-bit field to
+enable or disable 
diff erent types of information. This includes information
+about data-mappings and kernel execution. It is recommended to build your
+application with debugging information enabled, this will enable filenames and
+variable declarations in the information messages. OpenMP Debugging information
+is enabled at any level of debugging so a full debug runtime is not required.
+For minimal debugging information compile with `-gline-tables-only`, or compile
+with `-g` for full debug information. A full list of flags supported by
+``LIBOMPTARGET_INFO`` is given below. 
+
+* Print all data arguments upon entering an OpenMP device kernel: ``0x01``
+* Indicate when a mapped address already exists in the device mapping 
table:
+  ``0x02``
+* Dump the contents of the device pointer map at kernel exit: ``0x04``
+* Print OpenMP kernel information from device plugins: ``0x10``
+
+Any combination of these flags can be used by setting the appropriate bits. For
+example, to enable printing all data active in an OpenMP target region along
+with ``CUDA`` information, run the following ``bash`` command.
+
+.. code-block:: console
+
+   $ env LIBOMPTARGET_INFO=$((1 << 0x1 | 1 << 0x10)) ./your-application
+
+Or, to enable every flag run with every bit set.
+
+.. code-block:: console
+
+   $ env LIBOMPTARGET_INFO=-1 ./your-application
+
 LLVM/OpenMP Target Host Runtime Plugins (``libomptarget.rtl.``)
 ---