pub struct CpuKernel;Expand description
Reference CPU kernel. Wraps RabitqPlusIndex::search_with_rerank.
Deterministic by construction (integer popcount scan + stable
exact L2² rerank with total-order tie break via position).
This is the default kernel every consumer gets for free; GPU / SIMD implementations plug in alongside it via registration.
Implementations§
Trait Implementations§
Source§impl VectorKernel for CpuKernel
impl VectorKernel for CpuKernel
Source§fn id(&self) -> &str
fn id(&self) -> &str
Stable identifier surfaced in stats + logs. Must be unique per
kernel type (e.g.
"cpu", "cuda:0", "metal").Source§fn caps(&self) -> KernelCaps
fn caps(&self) -> KernelCaps
Capability advertisement — what this kernel can do. Return a
fresh struct (not a static reference) so kernels can narrow
caps at runtime (e.g. GPU-down →
min_batch = usize::MAX).Source§fn scan(&self, req: ScanRequest<'_>) -> Result<ScanResponse, RabitqError>
fn scan(&self, req: ScanRequest<'_>) -> Result<ScanResponse, RabitqError>
Run the scan + rerank for every query in
req. Returns one
Vec<SearchResult> per query, in the input order.impl Copy for CpuKernel
Auto Trait Implementations§
impl Freeze for CpuKernel
impl RefUnwindSafe for CpuKernel
impl Send for CpuKernel
impl Sync for CpuKernel
impl Unpin for CpuKernel
impl UnsafeUnpin for CpuKernel
impl UnwindSafe for CpuKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more