[libc-commits] [PATCH] D146861: [libc] Enable integration tests targeting NVIDIA GPUs

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Sat Mar 25 07:01:30 PDT 2023


jhuber6 updated this revision to Diff 508306.
jhuber6 added a comment.

The generator expressions should only be used for NVPTX.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146861

Files:
  libc/cmake/modules/LLVMLibCTestRules.cmake
  libc/utils/gpu/loader/CMakeLists.txt


Index: libc/utils/gpu/loader/CMakeLists.txt
===================================================================
--- libc/utils/gpu/loader/CMakeLists.txt
+++ libc/utils/gpu/loader/CMakeLists.txt
@@ -24,4 +24,12 @@
     PROPERTIES
       EXECUTABLE "$<TARGET_FILE:amdhsa_loader>"
   )
+elseif(TARGET nvptx_loader AND LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX)
+  add_custom_target(libc.utils.gpu.loader)
+  add_dependencies(libc.utils.gpu.loader nvptx_loader)
+  set_target_properties(
+    libc.utils.gpu.loader
+    PROPERTIES
+      EXECUTABLE "$<TARGET_FILE:nvptx_loader>"
+  )
 endif()
Index: libc/cmake/modules/LLVMLibCTestRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCTestRules.cmake
+++ libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -484,6 +484,8 @@
   add_executable(
     ${fq_build_target_name}
     EXCLUDE_FROM_ALL
+    # The NVIDIA 'nvlink' linker does not currently support static libraries.
+    $<$<BOOL:${LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX}>:${link_object_files}>
     ${INTEGRATION_TEST_SRCS}
     ${INTEGRATION_TEST_HDRS}
   )
@@ -510,9 +512,12 @@
   endif()
 
   target_link_options(${fq_build_target_name} PRIVATE -nostdlib -static)
-  target_link_libraries(${fq_build_target_name} ${fq_target_name}.__libc__
-                        libc.startup.${LIBC_TARGET_OS}.crt1
-                        libc.test.IntegrationTest.test)
+  target_link_libraries(
+    ${fq_build_target_name}
+    # The NVIDIA 'nvlink' linker does not currently support static libraries.
+    $<$<NOT:$<BOOL:${LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX}>>:${fq_target_name}.__libc__>
+    libc.startup.${LIBC_TARGET_OS}.crt1
+    libc.test.IntegrationTest.test)
   add_dependencies(${fq_build_target_name}
                    libc.test.IntegrationTest.test
                    ${INTEGRATION_TEST_DEPENDS})


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146861.508306.patch
Type: text/x-patch
Size: 1858 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230325/6f234829/attachment.bin>


More information about the libc-commits mailing list