Skip to content

Commit 1de3166

Browse files
committed
Make: Move drafts
1 parent 38014ee commit 1de3166

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ Using modern syntax, this is how you build and run the test suite:
129129

130130
```bash
131131
cmake -D STRINGZILLA_BUILD_TEST=1 -D CMAKE_BUILD_TYPE=Debug -B build_debug
132-
cmake --build build_debug --config Debug # Which will produce the following targets:
133-
build_debug/stringzilla_test_cpp20 # Unit test for the entire library compiled for current hardware
132+
cmake --build build_debug --config Debug # Which will produce the following targets:
133+
build_debug/stringzilla_test_cpp20 # Unit test for the entire library compiled for current hardware
134134
build_debug/stringzilla_test_cpp20_serial # x86 variant compiled for IvyBridge - last arch. before AVX2
135135
build_debug/stringzilla_test_cpp20_serial # Arm variant compiled without Neon
136136
```

c/lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ SZ_DYNAMIC void sz_dispatch_table_init(void) {
224224

225225
impl->edit_distance = sz_edit_distance_serial;
226226
impl->alignment_score = sz_alignment_score_serial;
227-
impl->hashes = sz_hashes_serial;
227+
impl->hashes = 0;
228228

229229
#if SZ_USE_HASWELL
230230
if (caps & sz_cap_haswell_k) {

include/stringzilla/hash.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ SZ_PUBLIC sz_u64_t sz_checksum_serial(sz_cptr_t text, sz_size_t length);
7878
/** @copydoc sz_hash */
7979
SZ_PUBLIC sz_u64_t sz_hash_serial(sz_cptr_t text, sz_size_t length);
8080

81-
/** @copydoc sz_hashes */
82-
SZ_PUBLIC void sz_hashes_serial( //
83-
sz_cptr_t text, sz_size_t length, sz_size_t window_length, sz_size_t window_step, //
84-
sz_hash_callback_t callback, void *callback_handle);
85-
8681
/** @copydoc sz_generate */
8782
SZ_PUBLIC void sz_generate_serial( //
8883
sz_cptr_t alphabet, sz_size_t cardinality, sz_ptr_t text, sz_size_t length, sz_random_generator_t generate,
@@ -261,7 +256,7 @@ SZ_PUBLIC sz_u64_t sz_checksum_haswell(sz_cptr_t text, sz_size_t length) {
261256
text_vec.ymm = _mm256_lddqu_si256((__m256i const *)text);
262257
sums_vec.ymm = _mm256_add_epi64(sums_vec.ymm, _mm256_sad_epu8(text_vec.ymm, _mm256_setzero_si256()));
263258
}
264-
// Accumulating 256 bits is harders, as we need to extract the 128-bit sums first.
259+
// Accumulating 256 bits is harder, as we need to extract the 128-bit sums first.
265260
__m128i low_xmm = _mm256_castsi256_si128(sums_vec.ymm);
266261
__m128i high_xmm = _mm256_extracti128_si256(sums_vec.ymm, 1);
267262
__m128i sums_xmm = _mm_add_epi64(low_xmm, high_xmm);
@@ -291,7 +286,7 @@ SZ_PUBLIC sz_u64_t sz_checksum_haswell(sz_cptr_t text, sz_size_t length) {
291286
sums_vec.ymm = _mm256_add_epi64(sums_vec.ymm, _mm256_sad_epu8(text_vec.ymm, _mm256_setzero_si256()));
292287
}
293288
}
294-
// When the biffer is huge, we can traverse it in 2 directions.
289+
// When the buffer is huge, we can traverse it in 2 directions.
295290
else {
296291
sz_u256_vec_t text_reversed_vec, sums_reversed_vec;
297292
sums_reversed_vec.ymm = _mm256_setzero_si256();
@@ -312,7 +307,7 @@ SZ_PUBLIC sz_u64_t sz_checksum_haswell(sz_cptr_t text, sz_size_t length) {
312307
// Handle the tail
313308
while (tail_length--) result += *text++;
314309

315-
// Accumulating 256 bits is harders, as we need to extract the 128-bit sums first.
310+
// Accumulating 256 bits is harder, as we need to extract the 128-bit sums first.
316311
__m128i low_xmm = _mm256_castsi256_si128(sums_vec.ymm);
317312
__m128i high_xmm = _mm256_extracti128_si256(sums_vec.ymm, 1);
318313
__m128i sums_xmm = _mm_add_epi64(low_xmm, high_xmm);

scripts/bench_token.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,26 @@ tracked_unary_functions_t hashing_functions() {
4646
}
4747

4848
tracked_unary_functions_t sliding_hashing_functions(std::size_t window_width, std::size_t step) {
49+
#if _SZ_DEPRECATED_FINGERPRINTS
4950
auto wrap_sz = [=](auto function) -> unary_function_t {
5051
return unary_function_t([function, window_width, step](std::string_view s) {
5152
sz_size_t mixed_hash = 0;
5253
function(s.data(), s.size(), window_width, step, _sz_hashes_fingerprint_scalar_callback, &mixed_hash);
5354
return mixed_hash;
5455
});
5556
};
57+
#endif
5658
std::string suffix = std::to_string(window_width) + ":step" + std::to_string(step);
5759
tracked_unary_functions_t result = {
60+
#if _SZ_DEPRECATED_FINGERPRINTS
5861
#if SZ_USE_ICE
5962
{"sz_hashes_ice:" + suffix, wrap_sz(sz_hashes_ice)},
6063
#endif
6164
#if SZ_USE_HASWELL
6265
{"sz_hashes_haswell:" + suffix, wrap_sz(sz_hashes_haswell)},
6366
#endif
6467
{"sz_hashes_serial:" + suffix, wrap_sz(sz_hashes_serial)},
68+
#endif
6569
};
6670
return result;
6771
}

0 commit comments

Comments
 (0)