[PATCH] D142570: [nvptx-arch] Remove `find_package(CUDA)` as it has been deprecated.

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 25 11:58:17 PST 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG759dec253695: [nvptx-arch] Remove `find_package(CUDA)` as it has been deprecated. (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142570

Files:
  clang/tools/nvptx-arch/CMakeLists.txt


Index: clang/tools/nvptx-arch/CMakeLists.txt
===================================================================
--- clang/tools/nvptx-arch/CMakeLists.txt
+++ clang/tools/nvptx-arch/CMakeLists.txt
@@ -9,18 +9,11 @@
 set(LLVM_LINK_COMPONENTS Support)
 add_clang_tool(nvptx-arch NVPTXArch.cpp)
 
-# TODO: This is deprecated. Since CMake 3.17 we can use FindCUDAToolkit instead.
-find_package(CUDA QUIET)
-find_library(cuda-library NAMES cuda PATHS /lib64)
-if (NOT cuda-library AND CUDA_FOUND)
-  get_filename_component(CUDA_LIBDIR "${CUDA_cudart_static_LIBRARY}" DIRECTORY)
-  find_library(cuda-library NAMES cuda HINTS "${CUDA_LIBDIR}/stubs")
-endif()
+find_package(CUDAToolkit QUIET)
 
 # If we found the CUDA library directly we just dynamically link against it.
-if (CUDA_FOUND AND cuda-library)
-  target_include_directories(nvptx-arch PRIVATE ${CUDA_INCLUDE_DIRS})
-  target_link_libraries(nvptx-arch PRIVATE ${cuda-library})
+if (CUDAToolkit_FOUND)
+  target_link_libraries(nvptx-arch PRIVATE CUDA::cuda_driver)
 else()
   target_compile_definitions(nvptx-arch PRIVATE "DYNAMIC_CUDA")
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142570.492211.patch
Type: text/x-patch
Size: 1100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230125/5dcbcb1d/attachment.bin>


More information about the cfe-commits mailing list