MCPcopy Create free account
hub / github.com/apache/arrow / KernelTraits

Class KernelTraits

cpp/src/arrow/util/bpacking_simd_kernel_internal.h:313–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311/// Packing all useful and derived information about a kernel in a single type.
312template <typename UnpackedUint, int kPackedBitSize, typename Arch>
313struct KernelTraits {
314 using unpacked_type = UnpackedUint;
315 /// The integer type to work with, `unpacked_type` or an appropriate type for bool.
316 using uint_type = std::conditional_t<std::is_same_v<unpacked_type, bool>,
317 SizedUint<sizeof(bool)>, unpacked_type>;
318 using arch_type = Arch;
319 using simd_batch = xsimd::batch<uint_type, arch_type>;
320 using simd_bytes = xsimd::batch<uint8_t, arch_type>;
321
322 static constexpr KernelShape kShape = {
323 .simd_bit_size_ = 8 * simd_bytes ::size,
324 .unpacked_bit_size_ = 8 * sizeof(UnpackedUint),
325 .packed_bit_size_ = kPackedBitSize,
326 };
327
328 static_assert(kShape.simd_bit_size() % kShape.unpacked_bit_size() == 0);
329 static_assert(0 < kShape.packed_bit_size());
330 static_assert(kShape.packed_bit_size() < kShape.simd_bit_size());
331};
332
333/// Return similar kernel traits but with a different integer unpacking type.
334template <typename KerTraits, typename Uint>

Callers

nothing calls this directly

Calls 3

simd_bit_sizeMethod · 0.80
unpacked_bit_sizeMethod · 0.80
packed_bit_sizeMethod · 0.80

Tested by

no test coverage detected