pub struct HardwareProfile {
pub backend: HardwareBackend,
pub has_cuda: bool,
pub has_rocm: bool,
pub cpu_logical_cores: usize,
pub has_avx2: bool,
pub has_avx512: bool,
}Expand description
Detected hardware capabilities.
Fields§
§backend: HardwareBackendActive GPU backend (highest priority GPU, or CpuSimd when none found).
has_cuda: boolCUDA-capable GPU found at runtime (NVIDIA only; requires gpu feature at compile time).
has_rocm: boolAMD ROCm/HIP GPU found at runtime.
cpu_logical_cores: usizeLogical CPU cores available to rayon’s global thread pool.
has_avx2: boolx86_64: AVX2 support detected via CPUID.
has_avx512: boolx86_64: AVX-512F support detected via CPUID.
Implementations§
Source§impl HardwareProfile
impl HardwareProfile
Sourcepub fn recommend_ivf_pq(&self, n_vectors: usize) -> bool
pub fn recommend_ivf_pq(&self, n_vectors: usize) -> bool
True when IVF-PQ training is justified for a dataset of n_vectors vectors.
Returns false when:
n_vectors < MIN_VECTORS_FOR_IVF_PQ(k-means clusters would be meaningless)- Neither GPU (CUDA or ROCm) nor a sufficiently parallel CPU is available
Auto Trait Implementations§
impl Freeze for HardwareProfile
impl RefUnwindSafe for HardwareProfile
impl Send for HardwareProfile
impl Sync for HardwareProfile
impl Unpin for HardwareProfile
impl UnsafeUnpin for HardwareProfile
impl UnwindSafe for HardwareProfile
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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