[Openmp-commits] [PATCH] D153628: OpenMP/cmake: Use TARGET_FILE instead of looking for amdgpu-arch

Matt Arsenault via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Jun 23 12:21:21 PDT 2023


arsenm updated this revision to Diff 534046.
arsenm added a comment.

I do not understand the contexts where generator expressions work. Also make execution a fatal error. If it's found it should work


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153628/new/

https://reviews.llvm.org/D153628

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
@@ -128,11 +128,17 @@
 # Looking for AMD GPUs...
 ################################################################################
 
-find_program(LIBOMPTARGET_AMDGPU_ARCH NAMES amdgpu-arch PATHS ${LLVM_BINARY_DIR}/bin)
+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)
+endif()
+
 if(LIBOMPTARGET_AMDGPU_ARCH)
   execute_process(COMMAND ${LIBOMPTARGET_AMDGPU_ARCH}
                   OUTPUT_VARIABLE LIBOMPTARGET_AMDGPU_ARCH_OUTPUT
-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+                  OUTPUT_STRIP_TRAILING_WHITESPACE
+                  COMMAND_ERROR_IS_FATAL ANY)
   string(REPLACE "\n" ";" amdgpu_arch_list "${LIBOMPTARGET_AMDGPU_ARCH_OUTPUT}")
   if(amdgpu_arch_list)
     set(LIBOMPTARGET_FOUND_AMDGPU_GPU TRUE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153628.534046.patch
Type: text/x-patch
Size: 1175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230623/5607de84/attachment.bin>


More information about the Openmp-commits mailing list