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

Function GenerateRandomPackedValues

cpp/src/arrow/util/bpacking_benchmark.cc:49–57  ·  view source on GitHub ↗

Generate random bytes as packed integers.

Source from the content-addressed store, hash-verified

47
48/// Generate random bytes as packed integers.
49std::vector<uint8_t> GenerateRandomPackedValues(int32_t num_values, int32_t bit_width) {
50 constexpr uint32_t kSeed = 3214;
51 const auto num_bytes = GetNumBytes(num_values, bit_width);
52
53 std::vector<uint8_t> out(num_bytes);
54 random_bytes(num_bytes, kSeed, out.data());
55
56 return out;
57}
58
59const uint8_t* GetNextAlignedByte(const uint8_t* ptr, std::size_t alignment) {
60 auto addr = reinterpret_cast<std::uintptr_t>(ptr);

Callers 1

BM_UnpackFunction · 0.85

Calls 3

GetNumBytesFunction · 0.70
random_bytesFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected