simd.cc (853B)
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/jpegli/simd.h" 7 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> 12 13 HWY_BEFORE_NAMESPACE(); 14 namespace jpegli { 15 namespace HWY_NAMESPACE { 16 17 size_t GetVectorSize() { return HWY_LANES(uint8_t); } 18 19 // NOLINTNEXTLINE(google-readability-namespace-comments) 20 } // namespace HWY_NAMESPACE 21 } // namespace jpegli 22 HWY_AFTER_NAMESPACE(); 23 24 #if HWY_ONCE 25 namespace jpegli { 26 namespace { 27 28 HWY_EXPORT(GetVectorSize); // Local function. 29 30 } // namespace 31 32 size_t VectorSize() { 33 static size_t bytes = HWY_DYNAMIC_DISPATCH(GetVectorSize)(); 34 return bytes; 35 } 36 37 } // namespace jpegli 38 #endif // HWY_ONCE