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),
| 434 | /// This limits restrictions set by the plan on the input memory reads built to avoid |
| 435 | /// reading overflow. |
| 436 | ARROW_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 | /// |
no outgoing calls
no test coverage detected