/src/libjxl/lib/jxl/simd_util.cc
Line | Count | Source |
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. |
5 | | |
6 | | #include "lib/jxl/simd_util.h" |
7 | | |
8 | | #include <cstddef> |
9 | | |
10 | | #undef HWY_TARGET_INCLUDE |
11 | | #define HWY_TARGET_INCLUDE "lib/jxl/simd_util.cc" |
12 | | #include <hwy/foreach_target.h> |
13 | | #include <hwy/highway.h> |
14 | | |
15 | | HWY_BEFORE_NAMESPACE(); |
16 | | namespace jxl { |
17 | | namespace HWY_NAMESPACE { |
18 | | |
19 | 5.98M | size_t MaxVectorSize() { |
20 | 5.98M | HWY_FULL(float) df; |
21 | 5.98M | return Lanes(df) * sizeof(float); |
22 | 5.98M | } Unexecuted instantiation: jxl::N_SSE4::MaxVectorSize() jxl::N_AVX2::MaxVectorSize() Line | Count | Source | 19 | 5.98M | size_t MaxVectorSize() { | 20 | 5.98M | HWY_FULL(float) df; | 21 | 5.98M | return Lanes(df) * sizeof(float); | 22 | 5.98M | } |
Unexecuted instantiation: jxl::N_SSE2::MaxVectorSize() |
23 | | |
24 | | // NOLINTNEXTLINE(google-readability-namespace-comments) |
25 | | } // namespace HWY_NAMESPACE |
26 | | } // namespace jxl |
27 | | HWY_AFTER_NAMESPACE(); |
28 | | |
29 | | #if HWY_ONCE |
30 | | namespace jxl { |
31 | | |
32 | | HWY_EXPORT(MaxVectorSize); |
33 | | |
34 | 5.98M | size_t MaxVectorSize() { |
35 | | // Ideally HWY framework should provide us this value. |
36 | | // Less than ideal is to check all available targets and choose maximal. |
37 | | // As for now, we just ask current active target, assuming it won't change. |
38 | 5.98M | return HWY_DYNAMIC_DISPATCH(MaxVectorSize)(); |
39 | 5.98M | } |
40 | | |
41 | | } // namespace jxl |
42 | | #endif |