From dcf229b701157934287bb003fb9dd875a31c7efe Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 27 Mar 2024 13:24:18 -0500 Subject: [PATCH] [libc] Disable testing for NVPTX debug builds Summary: Debug builds don't optimize out certain parts of the code that end up making the GPU backend crash. This results in regular builds not being successful just to build the testing objects. Disable them for now in debug mode. --- libc/cmake/modules/prepare_libc_gpu_build.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libc/cmake/modules/prepare_libc_gpu_build.cmake b/libc/cmake/modules/prepare_libc_gpu_build.cmake index bea6bb016491b..20aca16990fc6 100644 --- a/libc/cmake/modules/prepare_libc_gpu_build.cmake +++ b/libc/cmake/modules/prepare_libc_gpu_build.cmake @@ -93,6 +93,11 @@ else() endif() set(LIBC_GPU_TARGET_ARCHITECTURE "${gpu_test_architecture}") +# The NVPTX backend cannot currently handle objects created in debug mode. +if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX AND CMAKE_BUILD_TYPE STREQUAL "Debug") + set(LIBC_GPU_TESTS_DISABLED TRUE) +endif() + # Identify the GPU loader utility used to run tests. set(LIBC_GPU_LOADER_EXECUTABLE "" CACHE STRING "Executable for the GPU loader.") if(LIBC_GPU_LOADER_EXECUTABLE)