Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions turbovec-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ crate-type = ["cdylib"]
turbovec-core = { package = "turbovec", path = "../turbovec" }
pyo3 = { version = "0.27.0", features = ["extension-module", "abi3-py39"] }
numpy = "0.27.0"

[build-dependencies]
pyo3-build-config = "0.27.0"
10 changes: 10 additions & 0 deletions turbovec-python/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn main() {
// Emit the platform-correct linker arguments for a Python extension
// module. On macOS this passes `-undefined dynamic_lookup` so symbols
// from the Python interpreter (e.g. `Py_True`) resolve at load time
// instead of failing the link step. Without it, a plain `cargo build`
// on macOS fails with "symbol(s) not found for architecture arm64"
// (issue #92). Building via maturin already injects these args; this
// makes a bare `cargo build` work too.
pyo3_build_config::add_extension_module_link_args();
}
6 changes: 4 additions & 2 deletions turbovec/src/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ unsafe fn score_4bit_block_neon(
for batch in 0..n_batches {
let g_start = batch * FLUSH_EVERY;
let g_end = (g_start + FLUSH_EVERY).min(n_byte_groups);
let n_groups = g_end - g_start;

let mut accum = [vdupq_n_u16(0); 4];

Expand Down Expand Up @@ -1097,7 +1096,6 @@ unsafe fn score_4query_block_neon(
for batch in 0..n_batches {
let g_start = batch * FLUSH_EVERY;
let g_end = (g_start + FLUSH_EVERY).min(n_byte_groups);
let n_groups = g_end - g_start;

let mut acc: [[uint16x8_t; 4]; 4] = [[vdupq_n_u16(0); 4]; 4];

Expand Down Expand Up @@ -1343,6 +1341,10 @@ pub(crate) fn block_pair_has_allowed(mask: Option<&[u64]>, base_vec_pair: usize)
/// VM / emulator that doesn't expose AVX2 to userspace). Without this
/// fallback, pre-AVX2 x86_64 silently returned empty top-k results
/// instead of falling back to a slower-but-correct kernel.
///
/// Not compiled on aarch64, where the NEON kernel is always available and
/// this scalar path is never reached (it would warn as dead code).
#[cfg(not(target_arch = "aarch64"))]
#[allow(clippy::too_many_arguments)]
fn score_query_into_heap(
qlut_uint8: &[u8],
Expand Down
Loading