[Openmp-commits] [PATCH] D154107: [OpenMP] Adjust using the NVPTX architecture detection tool

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 29 09:34:39 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, arsenm, JonChesterfield.
Herald added subscribers: sunshaoce, mattd, gchakrabarti, asavonic, guansong, tpr, yaxunl.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: openmp-commits, jplehr, sstefan1, wdng.
Herald added a project: OpenMP.

A previous patch by @arsenm adjusted these to find the `amdgpu-arch`
tool correctly if we do a `LLVM_ENABLE_PROJECTS` build. This patch
applies the same to `nvptx-arch` tool to keep it consistent.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154107

Files:
  openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake


Index: openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
===================================================================
--- openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -110,7 +110,13 @@
 ################################################################################
 set(LIBOMPTARGET_DEP_CUDA_ARCH "sm_35")
 
-find_program(LIBOMPTARGET_NVPTX_ARCH NAMES nvptx-arch PATHS ${LLVM_BINARY_DIR}/bin)
+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)
+endif()
+
 if(LIBOMPTARGET_NVPTX_ARCH)
   execute_process(COMMAND ${LIBOMPTARGET_NVPTX_ARCH}
                   OUTPUT_VARIABLE LIBOMPTARGET_NVPTX_ARCH_OUTPUT
@@ -131,7 +137,8 @@
 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_BINARY_DIR}/bin)
+  find_program(LIBOMPTARGET_AMDGPU_ARCH NAMES amdgpu-arch
+               PATHS ${LLVM_TOOLS_BINARY_DIR}/bin)
 endif()
 
 if(LIBOMPTARGET_AMDGPU_ARCH)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154107.535851.patch
Type: text/x-patch
Size: 1270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230629/885dab7e/attachment.bin>


More information about the Openmp-commits mailing list