diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake --- a/libc/cmake/modules/LLVMLibCTestRules.cmake +++ b/libc/cmake/modules/LLVMLibCTestRules.cmake @@ -421,7 +421,7 @@ "INTEGRATION_TEST" "" # No optional arguments "SUITE" # Single value arguments - "SRCS;HDRS;DEPENDS;ARGS;ENV;COMPILE_OPTIONS" # Multi-value arguments + "SRCS;HDRS;DEPENDS;ARGS;ENV;COMPILE_OPTIONS;LOADER_ARGS" # Multi-value arguments ${ARGN} ) @@ -533,6 +533,7 @@ ${fq_target_name} COMMAND ${INTEGRATION_TEST_ENV} $<$:${gpu_loader_exe}> + ${INTEGRATION_TEST_LOADER_ARGS} $ ${INTEGRATION_TEST_ARGS} COMMENT "Running integration test ${fq_target_name}" ) diff --git a/libc/test/integration/startup/gpu/CMakeLists.txt b/libc/test/integration/startup/gpu/CMakeLists.txt --- a/libc/test/integration/startup/gpu/CMakeLists.txt +++ b/libc/test/integration/startup/gpu/CMakeLists.txt @@ -20,4 +20,8 @@ rpc_test.cpp DEPENDS libc.src.__support.RPC.rpc_client + libc.src.__support.GPU.utils + LOADER_ARGS + --blocks 16 + --threads 1 ) diff --git a/libc/test/integration/startup/gpu/rpc_test.cpp b/libc/test/integration/startup/gpu/rpc_test.cpp --- a/libc/test/integration/startup/gpu/rpc_test.cpp +++ b/libc/test/integration/startup/gpu/rpc_test.cpp @@ -6,15 +6,16 @@ // //===----------------------------------------------------------------------===// +#include "src/__support/GPU/utils.h" #include "src/__support/RPC/rpc_client.h" #include "test/IntegrationTest/test.h" using namespace __llvm_libc; static void test_add_simple() { - constexpr int num_additions = 10000; + uint32_t num_additions = 1000 + 10 * get_block_id_x(); uint64_t cnt = 0; - for (int i = 0; i < num_additions; ++i) { + for (uint32_t i = 0; i < num_additions; ++i) { rpc::Port port = rpc::client.open(rpc::TEST_INCREMENT); port.send_and_recv( [=](rpc::Buffer *buffer) { @@ -30,5 +31,6 @@ TEST_MAIN(int argc, char **argv, char **envp) { test_add_simple(); + return 0; }