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

Function adjust_bytes_per_read

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

Utility to map a desired number of bits to the smallest feasible size. When needing to read @p bits_per_read, find the next possible size that can be read in one operation. This is used to adjust the number of input bytes to kernel reads. For instance if a kernel plan needs to read 47 bits, instead of reading a whole SIMD register of data (which would restrict it to larger input memory buffers),

Source from the content-addressed store, hash-verified

434/// This limits restrictions set by the plan on the input memory reads built to avoid
435/// reading overflow.
436ARROW_FORCE_INLINE constexpr int adjust_bytes_per_read(int bits_per_read,
437 int simd_byte_size) {
438 if (bits_per_read <= static_cast<int>(8 * sizeof(uint32_t))) {
439 return sizeof(uint32_t);
440 } else if (bits_per_read <= static_cast<int>(8 * sizeof(uint64_t))) {
441 return sizeof(uint64_t);
442 }
443 return simd_byte_size;
444}
445
446/// Compile time constants of a Medium kernel.
447///

Callers 2

bytes_per_readMethod · 0.85
bytes_per_readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected