Backed out 3 changesets (bug 1790375) for causing wd failures on fetch_error.py....
[gecko.git] / third_party / jpeg-xl / lib / jpegli / simd.cc
blob5e849393426acba3bc267deca37fc41e39b8c061
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file.
6 #include "lib/jpegli/simd.h"
8 #undef HWY_TARGET_INCLUDE
9 #define HWY_TARGET_INCLUDE "lib/jpegli/simd.cc"
10 #include <hwy/foreach_target.h>
11 #include <hwy/highway.h>
13 HWY_BEFORE_NAMESPACE();
14 namespace jpegli {
15 namespace HWY_NAMESPACE {
17 size_t GetVectorSize() { return HWY_LANES(uint8_t); }
19 // NOLINTNEXTLINE(google-readability-namespace-comments)
20 } // namespace HWY_NAMESPACE
21 } // namespace jpegli
22 HWY_AFTER_NAMESPACE();
24 #if HWY_ONCE
25 namespace jpegli {
26 namespace {
28 HWY_EXPORT(GetVectorSize); // Local function.
30 } // namespace
32 size_t VectorSize() {
33 static size_t bytes = HWY_DYNAMIC_DISPATCH(GetVectorSize)();
34 return bytes;
37 } // namespace jpegli
38 #endif // HWY_ONCE