diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 20afd1fd1a720..a0e63053fb4e4 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -103,7 +103,7 @@ jobs: docker exec --user dev check_clang_tidy /home/dev/taichi/.github/workflows/scripts/check_clang_tidy.sh "$CI_SETUP_CMAKE_ARGS" env: CR_PAT: ${{ secrets.GITHUB_TOKEN }} - CI_SETUP_CMAKE_ARGS: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=ON -DTI_WITH_VULKAN:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON -DTI_WITH_BACKTRACE:BOOL=ON + CI_SETUP_CMAKE_ARGS: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_CC:BOOL=ON -DTI_WITH_VULKAN:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON -DTI_BUILD_CI:BOOL=ON -DTI_WITH_BACKTRACE:BOOL=ON build_and_test_cpu_mac: name: Build and Test macos (CPU) @@ -149,6 +149,7 @@ jobs: -DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_C_API=ON -DTI_WITH_BACKTRACE:BOOL=ON + -DTI_BUILD_CI:BOOL=ON -DTI_BUILD_TESTS:BOOL=${{ matrix.with_cpp_tests }} # [DEBUG] Copy this step around to enable debugging inside Github Action instances. @@ -214,6 +215,7 @@ jobs: -DTI_WITH_VULKAN:BOOL=ON -DTI_WITH_BACKTRACE:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON + -DTI_BUILD_CI:BOOL=ON -DTI_WITH_C_API=ON - name: Check C-API Export Symbols @@ -302,6 +304,7 @@ jobs: -DTI_WITH_VULKAN:BOOL=OFF -DTI_WITH_OPENGL:BOOL=OFF -DTI_BUILD_TESTS:BOOL=ON + -DTI_BUILD_CI:BOOL=ON - name: Test id: test @@ -370,6 +373,7 @@ jobs: -DTI_WITH_DX12:BOOL=ON -DTI_WITH_CC:BOOL=OFF -DTI_BUILD_TESTS:BOOL=ON + -DTI_BUILD_CI:BOOL=ON -DTI_WITH_BACKTRACE=ON -DTI_WITH_C_API=ON @@ -431,6 +435,7 @@ jobs: -DTI_WITH_CC:BOOL=OFF -DTI_WITH_VULKAN:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON + -DTI_BUILD_CI:BOOL=ON -DTI_WITH_BACKTRACE:BOOL=ON -DTI_WITH_C_API=ON diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a220b8570364..360bf50dc0ff5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) option(USE_LLD "Use lld (from llvm) linker" OFF) option(USE_MOLD "Use mold (A Modern Linker)" OFF) +option(TI_BUILD_CI "(Internal Use) Enable certain validations and possible debuggers for Taichi CI system" OFF) option(TI_WITH_BACKTRACE "Use backward-cpp to print out C++ stack trace upon failure" OFF) if(LINUX OR APPLE) diff --git a/c_api/src/taichi_core_impl.cpp b/c_api/src/taichi_core_impl.cpp index 4c60bcf8b0bf6..97faebef0ed10 100644 --- a/c_api/src/taichi_core_impl.cpp +++ b/c_api/src/taichi_core_impl.cpp @@ -225,7 +225,7 @@ TiRuntime ti_create_runtime(TiArch arch) { switch (arch) { #ifdef TI_WITH_VULKAN case TI_ARCH_VULKAN: { -#ifdef TI_BUILD_TESTS +#ifdef TI_BUILD_CI auto param = make_vulkan_runtime_creator_params(); param.enable_validation_layer = true; auto vulkan_runtime = new VulkanRuntimeOwned(std::move(param)); diff --git a/cmake/TaichiCore.cmake b/cmake/TaichiCore.cmake index d65ebcdf46330..3aaea31358214 100644 --- a/cmake/TaichiCore.cmake +++ b/cmake/TaichiCore.cmake @@ -93,14 +93,14 @@ file(GLOB TAICHI_CORE_SOURCE "taichi/rhi/*.h" "taichi/rhi/*.cpp" ) -if(TI_BUILD_TESTS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTI_BUILD_TESTS") -endif() - if(TI_WITH_LLVM) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTI_WITH_LLVM") endif() +if(TI_BUILD_CI) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTI_BUILD_CI") +endif() + ## This version var is only used to locate slim_libdevice.10.bc if(NOT CUDA_VERSION) set(CUDA_VERSION 10.0) diff --git a/taichi/rhi/vulkan/vulkan_device_creator.cpp b/taichi/rhi/vulkan/vulkan_device_creator.cpp index 960d1236bd18e..02181fdb4753c 100644 --- a/taichi/rhi/vulkan/vulkan_device_creator.cpp +++ b/taichi/rhi/vulkan/vulkan_device_creator.cpp @@ -72,7 +72,7 @@ vk_debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, snprintf(msg_buf, sizeof(msg_buf), "Vulkan validation layer: %d, %s", message_type, p_callback_data->pMessage); -#ifdef TI_BUILD_TESTS +#ifdef TI_BUILD_CI auto msg_name = std::string(p_callback_data->pMessageIdName); if (!vk_ignore_validation_warning(msg_name)) TI_ERROR(msg_buf);