Skip to content

Commit 914ed42

Browse files
Merge pull request #451 from apache/fix_bit_packing
Improve bit packing
2 parents 3914ef8 + 9639606 commit 914ed42

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

theta/include/bit_packing.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -6201,7 +6201,7 @@ static inline void pack_bits_block8(const uint64_t* values, uint8_t* ptr, uint8_
62016201
case 61: pack_bits_61(values, ptr); break;
62026202
case 62: pack_bits_62(values, ptr); break;
62036203
case 63: pack_bits_63(values, ptr); break;
6204-
default: throw std::logic_error("wrong number of bits " + std::to_string(bits));
6204+
default: throw std::logic_error("wrong number of bits in pack_bits_block8: " + std::to_string(bits));
62056205
}
62066206
}
62076207

@@ -6270,7 +6270,7 @@ static inline void unpack_bits_block8(uint64_t* values, const uint8_t* ptr, uint
62706270
case 61: unpack_bits_61(values, ptr); break;
62716271
case 62: unpack_bits_62(values, ptr); break;
62726272
case 63: unpack_bits_63(values, ptr); break;
6273-
default: throw std::logic_error("wrong number of bits " + std::to_string(bits));
6273+
default: throw std::logic_error("wrong number of bits in unpack_bits_block8: " + std::to_string(bits));
62746274
}
62756275
}
62766276

theta/test/bit_packing_test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static const uint64_t IGOLDEN64 = 0x9e3779b97f4a7c13ULL;
3030

3131
TEST_CASE("pack unpack bits") {
3232
uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
33-
for (int m = 0; m < 100; ++m) {
33+
for (int m = 0; m < 10000; ++m) {
3434
for (uint8_t bits = 1; bits <= 63; ++bits) {
3535
int n = 8;
3636
const uint64_t mask = (1ULL << bits) - 1;
@@ -61,7 +61,7 @@ TEST_CASE("pack unpack bits") {
6161

6262
TEST_CASE("pack unpack blocks") {
6363
uint64_t value = 0xaa55aa55aa55aa55ULL; // arbitrary starting value
64-
for (int n = 0; n < 100; ++n) {
64+
for (int n = 0; n < 10000; ++n) {
6565
for (uint8_t bits = 1; bits <= 63; ++bits) {
6666
const uint64_t mask = (1ULL << bits) - 1;
6767
std::vector<uint64_t> input(8, 0);

0 commit comments

Comments
 (0)