4343namespace arrow ::internal::bpacking {
4444
4545template <typename T, std::size_t N>
46- ARROW_FORCE_INLINE constexpr std::array<T, N> BuildConstantArray (T val) {
46+ ARROW_FORCE_INLINE inline constexpr std::array<T, N> BuildConstantArray (T val) {
4747 std::array<T, N> out = {};
4848 for (auto & v : out) {
4949 v = val;
@@ -52,7 +52,8 @@ ARROW_FORCE_INLINE constexpr std::array<T, N> BuildConstantArray(T val) {
5252}
5353
5454template <typename Arr>
55- ARROW_FORCE_INLINE constexpr Arr BuildConstantArrayLike (typename Arr::value_type val) {
55+ ARROW_FORCE_INLINE inline constexpr Arr BuildConstantArrayLike (
56+ typename Arr::value_type val) {
5657 return BuildConstantArray<typename Arr::value_type, std::tuple_size_v<Arr>>(val);
5758}
5859
@@ -62,7 +63,7 @@ ARROW_FORCE_INLINE constexpr Arr BuildConstantArrayLike(typename Arr::value_type
6263
6364// / Simple constexpr maximum element suited for non empty arrays.
6465template <typename T, std::size_t N>
65- ARROW_FORCE_INLINE constexpr T max_value (const std::array<T, N>& arr) {
66+ ARROW_FORCE_INLINE inline constexpr T max_value (const std::array<T, N>& arr) {
6667 static_assert (N > 0 );
6768 T out = 0 ;
6869 for (const T& v : arr) {
@@ -74,7 +75,7 @@ ARROW_FORCE_INLINE constexpr T max_value(const std::array<T, N>& arr) {
7475}
7576
7677template <std::array kArr , typename Arch, std::size_t ... Is>
77- ARROW_FORCE_INLINE constexpr auto array_to_batch_constant_impl (
78+ ARROW_FORCE_INLINE inline constexpr auto array_to_batch_constant_impl (
7879 std::index_sequence<Is...>) {
7980 using Array = std::decay_t <decltype (kArr )>;
8081 using value_type = typename Array::value_type;
@@ -84,20 +85,20 @@ ARROW_FORCE_INLINE constexpr auto array_to_batch_constant_impl(
8485
8586// / Make a ``xsimd::batch_constant`` from a static constexpr array.
8687template <std::array kArr , typename Arch>
87- ARROW_FORCE_INLINE constexpr auto array_to_batch_constant () {
88+ ARROW_FORCE_INLINE inline constexpr auto array_to_batch_constant () {
8889 return array_to_batch_constant_impl<kArr , Arch>(
8990 std::make_index_sequence<kArr .size ()>());
9091}
9192
9293template <typename Uint, typename Arch>
93- ARROW_FORCE_INLINE xsimd::batch<uint8_t , Arch> load_val_as (const uint8_t * in) {
94+ ARROW_FORCE_INLINE inline xsimd::batch<uint8_t , Arch> load_val_as (const uint8_t * in) {
9495 const Uint val = util::SafeLoadAs<Uint>(in);
9596 const auto batch = xsimd::batch<Uint, Arch>(val);
9697 return xsimd::bitwise_cast<uint8_t >(batch);
9798}
9899
99100template <int kBytes , typename Arch>
100- ARROW_FORCE_INLINE xsimd::batch<uint8_t , Arch> safe_load_bytes (const uint8_t * in) {
101+ ARROW_FORCE_INLINE inline xsimd::batch<uint8_t , Arch> safe_load_bytes (const uint8_t * in) {
101102 if constexpr (kBytes <= sizeof (uint64_t )) {
102103 return load_val_as<SizedUint<kBytes >, Arch>(in);
103104 }
@@ -106,7 +107,7 @@ ARROW_FORCE_INLINE xsimd::batch<uint8_t, Arch> safe_load_bytes(const uint8_t* in
106107}
107108
108109template <typename Int, int kOffset , int kLength , typename Arr>
109- ARROW_FORCE_INLINE constexpr auto select_stride_impl (Arr shifts) {
110+ ARROW_FORCE_INLINE inline constexpr auto select_stride_impl (Arr shifts) {
110111 std::array<Int, shifts.size () / kLength > out{};
111112 for (std::size_t i = 0 ; i < out.size (); ++i) {
112113 out[i] = shifts[kLength * i + kOffset ];
@@ -133,7 +134,7 @@ ARROW_FORCE_INLINE constexpr auto select_stride_impl(Arr shifts) {
133134// / while an offset of 1 would return the values:
134135// / |1|3|5|7|
135136template <typename ToInt, int kOffset , typename Int, typename Arch, Int... kShifts >
136- ARROW_FORCE_INLINE constexpr auto select_stride (
137+ ARROW_FORCE_INLINE inline constexpr auto select_stride (
137138 xsimd::batch_constant<Int, Arch, kShifts ...>) {
138139 static_assert (kOffset < sizeof (ToInt) / sizeof (Int));
139140 constexpr auto kStridesArr =
@@ -166,9 +167,9 @@ constexpr bool IsNeon = std::is_base_of_v<xsimd::neon, Arch>;
166167// / TODO(xsimd) Tracking in https://github.com/xtensor-stack/xsimd/pull/1220
167168// / When migrating, be sure to use batch_constant overload, and not the batch one.
168169template <typename Arch, typename Int, Int... kShifts >
169- ARROW_FORCE_INLINE auto left_shift (const xsimd::batch<Int, Arch>& batch,
170- xsimd::batch_constant <Int, Arch, kShifts ...> shifts)
171- -> xsimd::batch<Int, Arch> {
170+ ARROW_FORCE_INLINE inline auto left_shift (
171+ const xsimd::batch <Int, Arch>& batch,
172+ xsimd::batch_constant<Int, Arch, kShifts ...> shifts) -> xsimd::batch<Int, Arch> {
172173 constexpr bool kIsSse2 = IsSse2<Arch>;
173174 constexpr bool kIsAvx2 = IsAvx2<Arch>;
174175 static_assert (
@@ -230,7 +231,7 @@ ARROW_FORCE_INLINE auto left_shift(const xsimd::batch<Int, Arch>& batch,
230231// / integers per second through vectorization, Software Practice & Experience 45 (1),
231232// / 2015. http://arxiv.org/abs/1209.2137
232233template <typename Arch, typename Int, Int... kShifts >
233- ARROW_FORCE_INLINE auto right_shift_by_excess (
234+ ARROW_FORCE_INLINE inline auto right_shift_by_excess (
234235 const xsimd::batch<Int, Arch>& batch,
235236 xsimd::batch_constant<Int, Arch, kShifts ...> shifts) {
236237 constexpr bool kIsSse2 = IsSse2<Arch>;
@@ -301,9 +302,9 @@ ARROW_FORCE_INLINE auto right_shift_by_excess(
301302// /
302303// / @see KernelShape
303304// / @see PackedMaxSpreadBytes
304- ARROW_FORCE_INLINE constexpr bool PackedIsOversizedForSimd (int simd_bit_size,
305- int unpacked_bit_size,
306- int packed_bit_size) {
305+ ARROW_FORCE_INLINE inline constexpr bool PackedIsOversizedForSimd (int simd_bit_size,
306+ int unpacked_bit_size,
307+ int packed_bit_size) {
307308 const int unpacked_per_simd = simd_bit_size / unpacked_bit_size;
308309
309310 const auto packed_per_read_for_offset = [&](int bit_offset) -> int {
@@ -511,8 +512,8 @@ constexpr MediumKernelPlanSize MediumKernelPlanSize::Build(
511512// / function advise kernel plans to read only read 64 bits.
512513// / This limits restrictions set by the plan on the input memory reads built to avoid
513514// / reading overflow.
514- ARROW_FORCE_INLINE constexpr int adjust_bytes_per_read (int bits_per_read,
515- int simd_byte_size) {
515+ ARROW_FORCE_INLINE inline constexpr int adjust_bytes_per_read (int bits_per_read,
516+ int simd_byte_size) {
516517 if (bits_per_read <= static_cast <int >(8 * sizeof (uint32_t ))) {
517518 return sizeof (uint32_t );
518519 } else if (bits_per_read <= static_cast <int >(8 * sizeof (uint64_t ))) {
@@ -724,8 +725,8 @@ struct MediumKernel {
724725 static constexpr int kBytesRead = kPlan .total_bytes_read();
725726
726727 template <int kReadIdx , int kSwizzleIdx , int kShiftIdx >
727- ARROW_FORCE_INLINE static void unpack_one_shift_impl (const simd_batch& words,
728- unpacked_type* out) {
728+ ARROW_FORCE_INLINE inline static void unpack_one_shift_impl (const simd_batch& words,
729+ unpacked_type* out) {
729730 constexpr auto kRightShiftsArr =
730731 kPlan .shifts .at (kReadIdx ).at (kSwizzleIdx ).at (kShiftIdx );
731732 constexpr auto kRightShifts = array_to_batch_constant<kRightShiftsArr , arch_type>();
@@ -748,7 +749,7 @@ struct MediumKernel {
748749 }
749750
750751 template <int kReadIdx , int kSwizzleIdx , int ... kShiftIds >
751- ARROW_FORCE_INLINE static void unpack_one_swizzle_impl (
752+ ARROW_FORCE_INLINE inline static void unpack_one_swizzle_impl (
752753 const simd_bytes& bytes, unpacked_type* out,
753754 std::integer_sequence<int , kShiftIds ...>) {
754755 constexpr auto kSwizzlesArr = kPlan .swizzles .at (kReadIdx ).at (kSwizzleIdx );
@@ -760,7 +761,7 @@ struct MediumKernel {
760761 }
761762
762763 template <int kReadIdx , int ... kSwizzleIds >
763- ARROW_FORCE_INLINE static void unpack_one_read_impl (
764+ ARROW_FORCE_INLINE inline static void unpack_one_read_impl (
764765 const uint8_t * in, unpacked_type* out, std::integer_sequence<int , kSwizzleIds ...>) {
765766 using ShiftSeq = std::make_integer_sequence<int , kPlanSize .shifts_per_swizzle ()>;
766767 const auto bytes =
@@ -769,13 +770,14 @@ struct MediumKernel {
769770 }
770771
771772 template <int ... kReadIds >
772- ARROW_FORCE_INLINE static void unpack_all_impl (
773+ ARROW_FORCE_INLINE inline static void unpack_all_impl (
773774 const uint8_t * in, unpacked_type* out, std::integer_sequence<int , kReadIds ...>) {
774775 using SwizzleSeq = std::make_integer_sequence<int , kPlanSize .swizzles_per_read ()>;
775776 (unpack_one_read_impl<kReadIds >(in, out, SwizzleSeq{}), ...);
776777 }
777778
778- ARROW_FORCE_INLINE static const uint8_t * unpack (const uint8_t * in, unpacked_type* out) {
779+ ARROW_FORCE_INLINE inline static const uint8_t * unpack (const uint8_t * in,
780+ unpacked_type* out) {
779781 using ReadSeq = std::make_integer_sequence<int , kPlanSize .reads_per_kernel ()>;
780782 unpack_all_impl (in, out, ReadSeq{});
781783 return in + (kPlan .unpacked_per_kernel () * kShape .packed_bit_size ()) / 8 ;
@@ -1013,8 +1015,8 @@ struct LargeKernel {
10131015 static constexpr int kBytesRead = kPlan .total_bytes_read();
10141016
10151017 template <int kReadIdx >
1016- ARROW_FORCE_INLINE static void unpack_one_read_impl (const uint8_t * in,
1017- unpacked_type* out) {
1018+ ARROW_FORCE_INLINE inline static void unpack_one_read_impl (const uint8_t * in,
1019+ unpacked_type* out) {
10181020 constexpr auto kLowSwizzles =
10191021 array_to_batch_constant<kPlan .low_swizzles .at (kReadIdx ), arch_type>();
10201022 constexpr auto kLowRShifts =
@@ -1049,12 +1051,13 @@ struct LargeKernel {
10491051 }
10501052
10511053 template <int ... kReadIds >
1052- ARROW_FORCE_INLINE static void unpack_all_impl (
1054+ ARROW_FORCE_INLINE inline static void unpack_all_impl (
10531055 const uint8_t * in, unpacked_type* out, std::integer_sequence<int , kReadIds ...>) {
10541056 (unpack_one_read_impl<kReadIds >(in, out), ...);
10551057 }
10561058
1057- ARROW_FORCE_INLINE static const uint8_t * unpack (const uint8_t * in, unpacked_type* out) {
1059+ ARROW_FORCE_INLINE inline static const uint8_t * unpack (const uint8_t * in,
1060+ unpacked_type* out) {
10581061 using ReadSeq = std::make_integer_sequence<int , kPlanSize .reads_per_kernel ()>;
10591062 unpack_all_impl (in, out, ReadSeq{});
10601063 return in + (kPlan .kPlanSize .unpacked_per_kernel () * kShape .packed_bit_size ()) / 8 ;
@@ -1073,7 +1076,8 @@ struct NoOpKernel {
10731076 static constexpr int kValuesUnpacked = 0 ;
10741077 static constexpr int kBytesRead = 0 ;
10751078
1076- ARROW_FORCE_INLINE static const uint8_t * unpack (const uint8_t * in, unpacked_type* out) {
1079+ ARROW_FORCE_INLINE inline static const uint8_t * unpack (const uint8_t * in,
1080+ unpacked_type* out) {
10771081 return in;
10781082 }
10791083};
@@ -1084,7 +1088,8 @@ struct CastingKernel : WorkingKernel {
10841088
10851089 static constexpr int kValuesUnpacked = WorkingKernel::kValuesUnpacked ;
10861090
1087- ARROW_FORCE_INLINE static const uint8_t * unpack (const uint8_t * in, unpacked_type* out) {
1091+ ARROW_FORCE_INLINE inline static const uint8_t * unpack (const uint8_t * in,
1092+ unpacked_type* out) {
10881093 using working_type = typename WorkingKernel::unpacked_type;
10891094
10901095 working_type buffer[kValuesUnpacked ] = {};
0 commit comments