Skip to content

Commit

Permalink
[Enhancement] remove noavx flags for simdjson (StarRocks#16896)
Browse files Browse the repository at this point in the history
  • Loading branch information
murphyatwork authored Jan 30, 2023
1 parent cb000c3 commit 509e1cf
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 42 deletions.
7 changes: 0 additions & 7 deletions be/src/exec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
7 changes: 0 additions & 7 deletions be/src/exprs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
8 changes: 0 additions & 8 deletions be/src/formats/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
7 changes: 0 additions & 7 deletions be/src/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
Expand Down
12 changes: 0 additions & 12 deletions be/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/build-thirdparty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 509e1cf

Please sign in to comment.