From 509e1cfd3c195386c90416ef2361a95fbf038782 Mon Sep 17 00:00:00 2001 From: Murphy <96611012+mofeiatwork@users.noreply.github.com> Date: Sun, 29 Jan 2023 20:01:17 -0800 Subject: [PATCH] [Enhancement] remove noavx flags for simdjson (#16896) --- be/src/exec/CMakeLists.txt | 7 ------- be/src/exprs/CMakeLists.txt | 7 ------- be/src/formats/CMakeLists.txt | 8 -------- be/src/util/CMakeLists.txt | 7 ------- be/test/CMakeLists.txt | 12 ------------ thirdparty/build-thirdparty.sh | 2 +- 6 files changed, 1 insertion(+), 42 deletions(-) diff --git a/be/src/exec/CMakeLists.txt b/be/src/exec/CMakeLists.txt index 3d726d0545546..675fb313270a1 100644 --- a/be/src/exec/CMakeLists.txt +++ b/be/src/exec/CMakeLists.txt @@ -227,13 +227,6 @@ set(EXEC_FILES stream/aggregate/stream_aggregate_operator.cpp stream/stream_aggregate_node.cpp) -# simdjson Runtime Implement Dispatch: https://github.com/simdjson/simdjson/blob/master/doc/implementation-selection.md#runtime-cpu-detection -# Unset architecture-specific flags to avoid breaking implement runtime dispatch. -if ("${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86" OR "${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86_64") - set_source_files_properties(json_scanner.cpp PROPERTIES COMPILE_FLAGS "-mno-avx -mno-avx2") - set_source_files_properties(json_parser.cpp PROPERTIES COMPILE_FLAGS "-mno-avx -mno-avx2") -endif() - add_library(Exec STATIC ${EXEC_FILES} ) diff --git a/be/src/exprs/CMakeLists.txt b/be/src/exprs/CMakeLists.txt index baceb26091cb3..7afe700c81473 100644 --- a/be/src/exprs/CMakeLists.txt +++ b/be/src/exprs/CMakeLists.txt @@ -89,10 +89,3 @@ set(EXPR_FILES ) add_library(Exprs ${EXPR_FILES}) - -# simdjson Runtime Implement Dispatch: https://github.com/simdjson/simdjson/blob/master/doc/implementation-selection.md#runtime-cpu-detection -# Unset architecture-specific flags to avoid breaking implement runtime dispatch. -if ("${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86" OR "${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86_64") - set_source_files_properties(json_functions.cpp PROPERTIES COMPILE_FLAGS -mno-avx) - set_source_files_properties(json_functions.cpp PROPERTIES COMPILE_FLAGS -mno-avx2) -endif() diff --git a/be/src/formats/CMakeLists.txt b/be/src/formats/CMakeLists.txt index cde78eb8865e4..cb13747585218 100644 --- a/be/src/formats/CMakeLists.txt +++ b/be/src/formats/CMakeLists.txt @@ -52,12 +52,4 @@ add_library(Formats STATIC parquet/file_reader.cpp ) -# simdjson Runtime Implement Dispatch: https://github.com/simdjson/simdjson/blob/master/doc/implementation-selection.md#runtime-cpu-detection -# Unset architecture-specific flags to avoid breaking implement runtime dispatch. -if ("${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86" OR "${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86_64") - set_source_files_properties(json/nullable_column.cpp PROPERTIES COMPILE_FLAGS -mno-avx) - set_source_files_properties(json/binary_column.cpp PROPERTIES COMPILE_FLAGS -mno-avx) - set_source_files_properties(json/numeric_column.cpp PROPERTIES COMPILE_FLAGS -mno-avx) -endif() - add_subdirectory(orc/apache-orc) \ No newline at end of file diff --git a/be/src/util/CMakeLists.txt b/be/src/util/CMakeLists.txt index 5cf17446f95ba..799cc77423546 100644 --- a/be/src/util/CMakeLists.txt +++ b/be/src/util/CMakeLists.txt @@ -99,13 +99,6 @@ set(UTIL_FILES debug/query_trace_impl.cpp ) -# simdjson Runtime Implement Dispatch: https://github.com/simdjson/simdjson/blob/master/doc/implementation-selection.md#runtime-cpu-detection -# Unset architecture-specific flags to avoid breaking implement runtime dispatch. -if ("${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86" OR "${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86_64") - set_source_files_properties(json.cpp PROPERTIES COMPILE_FLAGS "-mno-avx -mno-avx2") - set_source_files_properties(json_converter.cpp PROPERTIES COMPILE_FLAGS "-mno-avx -mno-avx2") -endif() - add_library(Util STATIC ${UTIL_FILES} ) diff --git a/be/test/CMakeLists.txt b/be/test/CMakeLists.txt index 424e6bb89aff1..077467071ff2e 100644 --- a/be/test/CMakeLists.txt +++ b/be/test/CMakeLists.txt @@ -339,18 +339,6 @@ if ("${WITH_BLOCK_CACHE}" STREQUAL "ON") list(APPEND EXEC_FILES ./block_cache/block_cache_test.cpp) list(APPEND EXEC_FILES ./io/cache_input_stream_test.cpp) endif () -# simdjson Runtime Implement Dispatch: https://github.com/simdjson/simdjson/blob/master/doc/implementation-selection.md#runtime-cpu-detection -# Unset architecture-specific flags to avoid breaking implement runtime dispatch. - -if ("${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86" OR "${CMAKE_BUILD_TARGET_ARCH}" STREQUAL "x86_64") - set_source_files_properties(./exprs/json_functions_test.cpp PROPERTIES COMPILE_FLAGS -mno-avx) - set_source_files_properties(./exprs/json_functions_test.cpp PROPERTIES COMPILE_FLAGS -mno-avx2) - set_source_files_properties(./exprs/json_functions_test.cpp PROPERTIES COMPILE_FLAGS -mno-avx) - set_source_files_properties(./exprs/json_functions_test.cpp PROPERTIES COMPILE_FLAGS -mno-avx2) - set_source_files_properties(./formats/json/binary_column_test.cpp PROPERTIES COMPILE_FLAGS -mno-avx2) - set_source_files_properties(./formats/json/numeric_column_test.cpp PROPERTIES COMPILE_FLAGS -mno-avx2) - set_source_files_properties(./formats/json/nullable_column_test.cpp PROPERTIES COMPILE_FLAGS -mno-avx2) -endif () if (USE_AVX2) set(EXEC_FILES ${EXEC_FILES} ./column/avx_numeric_column_test.cpp) diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index c51ae4cce5ff9..559e33fe8234d 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -328,7 +328,7 @@ build_simdjson() { #ref: https://github.com/simdjson/simdjson/blob/master/HACKING.md mkdir -p $BUILD_DIR cd $BUILD_DIR - $CMAKE_CMD -G "${CMAKE_GENERATOR}" -DCMAKE_CXX_FLAGS="-O3" -DCMAKE_C_FLAGS="-O3" -DSIMDJSON_AVX512_ALLOWED=OFF .. + $CMAKE_CMD -G "${CMAKE_GENERATOR}" -DCMAKE_CXX_FLAGS="-O3" -DCMAKE_C_FLAGS="-O3" -DSIMDJSON_AVX512_ALLOWED=ON .. $CMAKE_CMD --build . mkdir -p $TP_INSTALL_DIR/lib