[llvm] [offload] Fix finding amdgpu/nvptx-arch to generate tests (PR #135072)

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 12:34:35 PDT 2025


https://github.com/jdenny-ornl created https://github.com/llvm/llvm-project/pull/135072

PR #134713, which landed as 79cb6f05da37, causes this on my test systems:

```
-- Building AMDGPU plugin for dlopened libhsa
-- Not generating AMDGPU tests, no supported devices detected. Use 'LIBOMPTARGET_FORCE_AMDGPU_TESTS' to override.
-- Building CUDA plugin for dlopened libcuda
-- Not generating NVIDIA tests, no supported devices detected. Use 'LIBOMPTARGET_FORCE_NVIDIA_TESTS' to override.
```

The problem is it cannot locate amdgpu-arch and nvptx-arch.  This patch enables it to.

I suspect there is more cleanup to do here.  amdgpu-arch and nvptx-arch do not appear to exist as cmake targets anymore, but there is still cmake code here that looks for those targets.

>From bcf1302adf23ef9ad656a793b684e55d9f988173 Mon Sep 17 00:00:00 2001
From: "Joel E. Denny" <jdenny.ornl at gmail.com>
Date: Wed, 9 Apr 2025 15:21:40 -0400
Subject: [PATCH] [offload] Fix finding amdgpu/nvptx-arch to generate tests

PR #134713, which landed as 79cb6f05da37, causes this on my test
systems:

```
-- Building AMDGPU plugin for dlopened libhsa
-- Not generating AMDGPU tests, no supported devices detected. Use 'LIBOMPTARGET_FORCE_AMDGPU_TESTS' to override.
-- Building CUDA plugin for dlopened libcuda
-- Not generating NVIDIA tests, no supported devices detected. Use 'LIBOMPTARGET_FORCE_NVIDIA_TESTS' to override.
```

The problem is it cannot locate amdgpu-arch and nvptx-arch.  This
patch enables it to.

I suspect there is more cleanup to do here.  amdgpu-arch and
nvptx-arch do not appear to exist as cmake targets anymore, but there
is still cmake code here that looks for those targets.
---
 offload/cmake/Modules/LibomptargetGetDependencies.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/offload/cmake/Modules/LibomptargetGetDependencies.cmake b/offload/cmake/Modules/LibomptargetGetDependencies.cmake
index c296f7ea3863e..2a8bdebf2c1dd 100644
--- a/offload/cmake/Modules/LibomptargetGetDependencies.cmake
+++ b/offload/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -51,7 +51,7 @@ if(TARGET nvptx-arch)
   get_property(LIBOMPTARGET_NVPTX_ARCH TARGET nvptx-arch PROPERTY LOCATION)
 else()
   find_program(LIBOMPTARGET_NVPTX_ARCH NAMES nvptx-arch
-               PATHS ${LLVM_TOOLS_BINARY_DIR}/bin)
+               PATHS ${LLVM_TOOLS_BINARY_DIR})
 endif()
 
 if(LIBOMPTARGET_NVPTX_ARCH)
@@ -75,7 +75,7 @@ if(TARGET amdgpu-arch)
   get_property(LIBOMPTARGET_AMDGPU_ARCH TARGET amdgpu-arch PROPERTY LOCATION)
 else()
   find_program(LIBOMPTARGET_AMDGPU_ARCH NAMES amdgpu-arch
-               PATHS ${LLVM_TOOLS_BINARY_DIR}/bin)
+               PATHS ${LLVM_TOOLS_BINARY_DIR})
 endif()
 
 if(LIBOMPTARGET_AMDGPU_ARCH)



More information about the llvm-commits mailing list