Skip to content

Commit

Permalink
Code adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
jim19930609 committed Dec 26, 2022
1 parent 47fe7cc commit f65dcce
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion c_api/src/taichi_core_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
8 changes: 4 additions & 4 deletions cmake/TaichiCore.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion taichi/rhi/vulkan/vulkan_device_creator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f65dcce

Please sign in to comment.