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

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Mar 27 06:47:26 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGb26970ec4b79: [libc] Enable integration tests targeting NVIDIA GPUs (authored by jhuber6).

Changed prior to commit:
  https://reviews.llvm.org/D146861?vs=508306&id=508630#toc

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_TARGET_ARCHITECTURE_IS_GPU}>:${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_TARGET_ARCHITECTURE_IS_GPU}>>:${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.508630.patch
Type: text/x-patch
Size: 1846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230327/ed32c009/attachment.bin>


More information about the libc-commits mailing list