From f794a072284bc2a9631f6144aa8bd9d264bc89a0 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 28 Apr 2021 15:56:06 +0200 Subject: Disable intel optimization on arm. --- vespalib/src/vespa/vespalib/hwaccelrated/CMakeLists.txt | 11 ++++++++--- vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp | 8 ++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'vespalib') diff --git a/vespalib/src/vespa/vespalib/hwaccelrated/CMakeLists.txt b/vespalib/src/vespa/vespalib/hwaccelrated/CMakeLists.txt index ac9d8d76074..c5797cbd432 100644 --- a/vespalib/src/vespa/vespalib/hwaccelrated/CMakeLists.txt +++ b/vespalib/src/vespa/vespalib/hwaccelrated/CMakeLists.txt @@ -1,12 +1,17 @@ # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(ACCEL_FILES "avx2.cpp" "avx512.cpp") +else() + unset(ACCEL_FILES) +endif() + vespa_add_library(vespalib_vespalib_hwaccelrated OBJECT SOURCES iaccelrated.cpp generic.cpp - avx2.cpp - avx512.cpp + ${ACCEL_FILES} DEPENDS ) -set_source_files_properties(avx.cpp PROPERTIES COMPILE_FLAGS -march=sandybridge) set_source_files_properties(avx2.cpp PROPERTIES COMPILE_FLAGS -march=haswell) set_source_files_properties(avx512.cpp PROPERTIES COMPILE_FLAGS -march=skylake-avx512) diff --git a/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp b/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp index de917c5f065..674efe75c17 100644 --- a/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp +++ b/vespalib/src/vespa/vespalib/hwaccelrated/iaccelrated.cpp @@ -2,8 +2,10 @@ #include "iaccelrated.h" #include "generic.h" +#ifdef __x86_64__ #include "avx2.h" #include "avx512.h" +#endif #include #include #include @@ -26,6 +28,7 @@ public: IAccelrated::UP create() const override { return std::make_unique(); } }; +#ifdef __x86_64__ class Avx2Factory :public Factory{ public: IAccelrated::UP create() const override { return std::make_unique(); } @@ -35,6 +38,7 @@ class Avx512Factory :public Factory{ public: IAccelrated::UP create() const override { return std::make_unique(); } }; +#endif template std::vector createAndFill(size_t sz) { @@ -255,6 +259,7 @@ private: Selector::Selector() : _factory() { +#ifdef __x86_64__ __builtin_cpu_init (); if (__builtin_cpu_supports("avx512f")) { _factory = std::make_unique(); @@ -263,6 +268,9 @@ Selector::Selector() : } else { _factory = std::make_unique(); } +#else + _factory = std::make_unique(); +#endif } } -- cgit v1.2.3