Skip to content

Commit 9ba2fce

Browse files
committed
Add documentation
1 parent fe69631 commit 9ba2fce

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

cpp/src/arrow/util/bpacking_simd_kernel_internal.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,15 @@ struct MediumKernelPlan {
491491
static constexpr auto kShape = Traits::kShape;
492492
static constexpr auto kPlanSize = MediumKernelPlanSize::Build(kShape, kOptions);
493493

494+
/// Array of byte offsets relative to the Kernel input memory address.
494495
using ReadsPerKernel = std::array<int, kPlanSize.reads_per_kernel()>;
495496

497+
/// Array of indices used for byte swizzle/shuffle in an SIMD register.
496498
using Swizzle = std::array<uint8_t, kShape.simd_byte_size()>;
497499
using SwizzlesPerRead = std::array<Swizzle, kPlanSize.swizzles_per_read()>;
498500
using SwizzlesPerKernel = std::array<SwizzlesPerRead, kPlanSize.reads_per_kernel()>;
499501

502+
/// Array of integer shifts for each unpacked integer in an SIMD register.
500503
using Shifts = std::array<uint_type, kShape.unpacked_per_simd()>;
501504
using ShiftsPerSwizzle = std::array<Shifts, kPlanSize.shifts_per_swizzle()>;
502505
using ShiftsPerRead = std::array<ShiftsPerSwizzle, kPlanSize.swizzles_per_read()>;
@@ -544,6 +547,8 @@ constexpr auto MediumKernelPlan<KerTraits, kOptions>::Build()
544547
plan.reads.at(r) = read_start_byte;
545548

546549
for (int sw = 0; sw < kPlanSize.swizzles_per_read(); ++sw) {
550+
// Not all swizzle values are defined. This is not an issue as these bits do not
551+
// influence the input (they will be masked away).
547552
constexpr int kUndefined = -1;
548553
plan.swizzles.at(r).at(sw) = BuildConstantArrayLike<Plan::Swizzle>(kUndefined);
549554
for (int sh = 0; sh < kPlanSize.shifts_per_swizzle(); ++sh) {
@@ -754,11 +759,14 @@ struct LargeKernelPlan {
754759
static constexpr auto kShape = Traits::kShape;
755760
static constexpr auto kPlanSize = LargeKernelPlanSize::Build(kShape);
756761

762+
/// Array of byte offsets relative to the Kernel input memory address.
757763
using ReadsPerKernel = std::array<int, kPlanSize.reads_per_kernel()>;
758764

765+
/// Array of indices used for byte swizzle/shuffle in an SIMD register.
759766
using Swizzle = std::array<uint8_t, kShape.simd_byte_size()>;
760767
using SwizzlesPerKernel = std::array<Swizzle, kPlanSize.reads_per_kernel()>;
761768

769+
/// Array of integer shifts for each unpacked integer in an SIMD register.
762770
using Shifts = std::array<uint_type, kShape.unpacked_per_simd()>;
763771
using ShitsPerKernel = std::array<Shifts, kPlanSize.reads_per_kernel()>;
764772

@@ -796,6 +804,8 @@ constexpr auto LargeKernelPlan<KerTraits>::Build() -> LargeKernelPlan<KerTraits>
796804
const int read_start_byte = packed_start_bit / 8;
797805
plan.reads.at(r) = read_start_byte;
798806

807+
// Not all swizzle values are defined. This is not an issue as these bits do not
808+
// influence the input (they will be masked away).
799809
constexpr int kUndefined = -1;
800810
plan.low_swizzles.at(r) = BuildConstantArrayLike<Plan::Swizzle>(kUndefined);
801811
plan.high_swizzles.at(r) = BuildConstantArrayLike<Plan::Swizzle>(kUndefined);

0 commit comments

Comments
 (0)