Use include_sse2neon.h in gcore/gdal_minmax_element.hpp

This commit is contained in:
Even Rouault 2024-11-03 22:30:20 +01:00
parent d922dc5763
commit b42f7a8a38
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D
2 changed files with 8 additions and 1 deletions

View File

@ -33,14 +33,18 @@
#error "Please define the GDAL_MINMAXELT_NS macro to define the namespace" #error "Please define the GDAL_MINMAXELT_NS macro to define the namespace"
#endif #endif
#ifdef USE_NEON_OPTIMIZATIONS
#include "include_sse2neon.h"
#define GDAL_MINMAX_ELEMENT_USE_SSE2
#else
#if defined(__x86_64) || defined(_M_X64) #if defined(__x86_64) || defined(_M_X64)
#define GDAL_MINMAX_ELEMENT_USE_SSE2 #define GDAL_MINMAX_ELEMENT_USE_SSE2
#endif #endif
#ifdef GDAL_MINMAX_ELEMENT_USE_SSE2 #ifdef GDAL_MINMAX_ELEMENT_USE_SSE2
// SSE2 header // SSE2 header
#include <emmintrin.h> #include <emmintrin.h>
#endif #endif
#endif
#include "gdal_priv_templates.hpp" #include "gdal_priv_templates.hpp"
#if GDAL_VERSION < GDAL_COMPUTE_VERSION(3, 10, 0) #if GDAL_VERSION < GDAL_COMPUTE_VERSION(3, 10, 0)

View File

@ -25,5 +25,8 @@ gdal_standard_includes(bench_ogr_c_api)
target_link_libraries(bench_ogr_c_api PRIVATE $<TARGET_NAME:${GDAL_LIB_TARGET_NAME}>) target_link_libraries(bench_ogr_c_api PRIVATE $<TARGET_NAME:${GDAL_LIB_TARGET_NAME}>)
gdal_test_target(testperf_gdal_minmax_element testperf_gdal_minmax_element.cpp) gdal_test_target(testperf_gdal_minmax_element testperf_gdal_minmax_element.cpp)
if (GDAL_ENABLE_ARM_NEON_OPTIMIZATIONS)
target_compile_definitions(testperf_gdal_minmax_element PRIVATE -DUSE_NEON_OPTIMIZATIONS)
endif()
add_test(NAME testperf_gdal_minmax_element COMMAND testperf_gdal_minmax_element) add_test(NAME testperf_gdal_minmax_element COMMAND testperf_gdal_minmax_element)
set_property(TEST testperf_gdal_minmax_element PROPERTY ENVIRONMENT "${TEST_ENV}") set_property(TEST testperf_gdal_minmax_element PROPERTY ENVIRONMENT "${TEST_ENV}")