diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt --- a/libc/test/src/__support/CMakeLists.txt +++ b/libc/test/src/__support/CMakeLists.txt @@ -20,31 +20,28 @@ libc.src.__support.common ) -# These tests fails with an illegal instruction -if(NOT LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX) - add_libc_test( - high_precision_decimal_test - SUITE - libc-support-tests - SRCS - high_precision_decimal_test.cpp - DEPENDS - libc.src.__support.high_precision_decimal - libc.src.__support.uint128 - ) +add_libc_test( + high_precision_decimal_test + SUITE + libc-support-tests + SRCS + high_precision_decimal_test.cpp + DEPENDS + libc.src.__support.high_precision_decimal + libc.src.__support.uint128 +) - add_libc_test( - str_to_float_test - SUITE - libc-support-tests - SRCS - str_to_float_test.cpp - DEPENDS - libc.src.__support.str_to_float - libc.src.__support.uint128 - libc.src.errno.errno - ) -endif() +add_libc_test( + str_to_float_test + SUITE + libc-support-tests + SRCS + str_to_float_test.cpp + DEPENDS + libc.src.__support.str_to_float + libc.src.__support.uint128 + libc.src.errno.errno +) add_libc_test( integer_to_string_test @@ -72,19 +69,16 @@ ) endif() -# This test fails with an illegal memory access on NVPTX. -if(NOT LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX) - add_libc_test( - uint_test - SUITE - libc-support-tests - SRCS - uint_test.cpp - DEPENDS - libc.src.__support.uint - libc.src.__support.CPP.optional - ) -endif() +add_libc_test( + uint_test + SUITE + libc-support-tests + SRCS + uint_test.cpp + DEPENDS + libc.src.__support.uint + libc.src.__support.CPP.optional +) add_libc_test( fixedvector_test @@ -96,8 +90,6 @@ libc.src.__support.fixedvector ) -# This test fails with a segmentation fault on NVPTX. -if(NOT LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX) add_libc_test( char_vector_test SUITE @@ -107,7 +99,6 @@ DEPENDS libc.src.__support.char_vector ) -endif() add_executable( libc_str_to_float_comparison_test diff --git a/libc/test/src/__support/CPP/CMakeLists.txt b/libc/test/src/__support/CPP/CMakeLists.txt --- a/libc/test/src/__support/CPP/CMakeLists.txt +++ b/libc/test/src/__support/CPP/CMakeLists.txt @@ -65,19 +65,16 @@ ) endif() -# This test fails with a segmentation fault on NVPTX. -if(NOT LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX) - add_libc_test( - stringstream_test - SUITE - libc-cpp-utils-tests - SRCS - stringstream_test.cpp - DEPENDS - libc.src.__support.CPP.span - libc.src.__support.CPP.stringstream - ) -endif() +add_libc_test( + stringstream_test + SUITE + libc-cpp-utils-tests + SRCS + stringstream_test.cpp + DEPENDS + libc.src.__support.CPP.span + libc.src.__support.CPP.stringstream +) add_libc_test( optional_test diff --git a/libc/test/src/__support/char_vector_test.cpp b/libc/test/src/__support/char_vector_test.cpp --- a/libc/test/src/__support/char_vector_test.cpp +++ b/libc/test/src/__support/char_vector_test.cpp @@ -20,7 +20,7 @@ CharVector v; ASSERT_EQ(v.length(), size_t(0)); - constexpr char test_str[] = "1234567890"; + static constexpr char test_str[] = "1234567890"; for (size_t i = 0; test_str[i] != '\0'; ++i) { v.append(test_str[i]); } @@ -32,7 +32,7 @@ ASSERT_EQ(v.length(), size_t(0)); // 100 characters (each row is 50) - constexpr char test_str[] = + static constexpr char test_str[] = "12345678901234567890123456789012345678901234567890" "ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxy"; for (size_t i = 0; test_str[i] != '\0'; ++i) { @@ -48,7 +48,7 @@ ASSERT_EQ(v.length(), size_t(0)); // 1000 characters - constexpr char test_str[] = + static constexpr char test_str[] = "12345678901234567890123456789012345678901234567890" "ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxy" "12345678901234567890123456789012345678901234567890" diff --git a/libc/utils/gpu/loader/nvptx/Loader.cpp b/libc/utils/gpu/loader/nvptx/Loader.cpp --- a/libc/utils/gpu/loader/nvptx/Loader.cpp +++ b/libc/utils/gpu/loader/nvptx/Loader.cpp @@ -233,6 +233,12 @@ if (CUresult err = cuCtxSetCurrent(context)) handle_error(err); + // Increase the stack size per thread. + // TODO: We should allow this to be passed in so only the tests that require a + // larger stack can specify it to save on memory usage. + if (CUresult err = cuCtxSetLimit(CU_LIMIT_STACK_SIZE, 3 * 1024)) + handle_error(err); + // Initialize a non-blocking CUDA stream to execute the kernel. CUstream stream; if (CUresult err = cuStreamCreate(&stream, CU_STREAM_NON_BLOCKING))