diff options
author | Ivan Blinkov <ivan@blinkov.ru> | 2022-02-10 16:47:11 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:11 +0300 |
commit | 5b283123c882433dafbaf6b338adeea16c1a0ea0 (patch) | |
tree | 339adc63bce23800021202ae4a8328a843dc447a /library/cpp/regex/hyperscan/hyperscan.cpp | |
parent | 1aeb9a455974457866f78722ad98114bafc84e8a (diff) | |
download | ydb-5b283123c882433dafbaf6b338adeea16c1a0ea0.tar.gz |
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/regex/hyperscan/hyperscan.cpp')
-rw-r--r-- | library/cpp/regex/hyperscan/hyperscan.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/regex/hyperscan/hyperscan.cpp b/library/cpp/regex/hyperscan/hyperscan.cpp index 8ef09665d0..ba321f9c29 100644 --- a/library/cpp/regex/hyperscan/hyperscan.cpp +++ b/library/cpp/regex/hyperscan/hyperscan.cpp @@ -8,27 +8,27 @@ #include <contrib/libs/hyperscan/runtime_avx2/hs_runtime.h> #include <contrib/libs/hyperscan/runtime_avx512/hs_common.h> #include <contrib/libs/hyperscan/runtime_avx512/hs_runtime.h> - -#include <util/generic/singleton.h> - + +#include <util/generic/singleton.h> + namespace NHyperscan { using TSerializedDatabase = THolder<char, TDeleter<decltype(&free), &free>>; using TCompileError = THolder<hs_compile_error_t, TDeleter<decltype(&hs_free_compile_error), &hs_free_compile_error>>; - namespace NPrivate { + namespace NPrivate { ERuntime DetectCurrentRuntime() { - if (NX86::HaveAVX512F() && NX86::HaveAVX512BW()) { + if (NX86::HaveAVX512F() && NX86::HaveAVX512BW()) { return ERuntime::AVX512; - } else if (NX86::HaveAVX() && NX86::HaveAVX2()) { + } else if (NX86::HaveAVX() && NX86::HaveAVX2()) { return ERuntime::AVX2; - } else if (NX86::HaveSSE42() && NX86::HavePOPCNT()) { + } else if (NX86::HaveSSE42() && NX86::HavePOPCNT()) { return ERuntime::Corei7; - } else { + } else { return ERuntime::Core2; - } - } - + } + } + TCPUFeatures RuntimeCpuFeatures(ERuntime runtime) { switch (runtime) { default: @@ -252,7 +252,7 @@ namespace NHyperscan { TString Serialize(const TDatabase& db) { char* databaseBytes = nullptr; size_t databaseLength; - hs_error_t status = Singleton<NPrivate::TImpl>()->SerializeDatabase( + hs_error_t status = Singleton<NPrivate::TImpl>()->SerializeDatabase( db.Get(), &databaseBytes, &databaseLength); @@ -265,7 +265,7 @@ namespace NHyperscan { TDatabase Deserialize(const TStringBuf& serialization) { hs_database_t* rawDb = nullptr; - hs_error_t status = Singleton<NPrivate::TImpl>()->DeserializeDatabase( + hs_error_t status = Singleton<NPrivate::TImpl>()->DeserializeDatabase( serialization.begin(), serialization.size(), &rawDb); |