For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
GitHubCUDA-X
    • Home
    • Installation
  • Getting Started
    • Introduction
    • Integrations
    • Use-cases
  • User Guide
    • API Guide
    • Benchmarking Guide
    • Field Guide
    • References
  • Developer Guide
    • Coding Guidelines
    • Contributing
  • API Reference
    • C API Documentation
    • Cpp API Documentation
    • Python API Documentation
    • Java API Documentation
    • Rust API Documentation
      • cuVS Cluster
      • cuVS Cluster Kmeans
      • cuVS Cluster Kmeans Params
      • cuVS
      • cuVS Dlpack
      • cuVS Error
      • cuVS Resources
      • cuVS Distance
      • cuVS Distance Type
      • cuVS Brute Force
      • cuVS Cagra
      • cuVS Cagra Index
      • cuVS Cagra Index Params
      • cuVS Cagra Search Params
      • cuVS IVF Flat
      • cuVS IVF Flat Index
      • cuVS IVF Flat Index Params
      • cuVS IVF Flat Search Params
      • cuVS IVF PQ
      • cuVS IVF PQ Index
      • cuVS IVF PQ Index Params
      • cuVS IVF PQ Search Params
      • cuVS Vamana
      • cuVS Vamana Index
      • cuVS Vamana Index Params
    • Go API Documentation
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogocuVS
GitHubCUDA-X
On this page
  • Index
  • build
  • Arguments
  • new
  • search
  • Arguments
API ReferenceRust API Documentation

Brute Force Module

||View as Markdown|
Previous

cuVS Distance Type

Next

cuVS Cagra

Rust module: cuvs::brute_force

Source: rust/cuvs/src/brute_force.rs

Brute Force KNN

Index

1#[derive(Debug)]
2pub struct Index {
3 /* private fields */
4}

Brute Force KNN Index

Methods

NameSource
buildrust/cuvs/src/brute_force.rs:32
newrust/cuvs/src/brute_force.rs:54
searchrust/cuvs/src/brute_force.rs:70

build

1pub fn build<T: Into<ManagedTensor>>(
2res: &Resources,
3metric: DistanceType,
4metric_arg: Option<f32>,
5dataset: T,
6) -> Result<Index>

Builds a new Brute Force KNN Index from the dataset for efficient search.

Arguments

  • res - Resources to use
  • metric - DistanceType to use for building the index
  • metric_arg - Optional value of p for Minkowski distances
  • dataset - A row-major matrix on either the host or device to index

Source: rust/cuvs/src/brute_force.rs:32

new

1pub fn new() -> Result<Index>

Creates a new empty index

Source: rust/cuvs/src/brute_force.rs:54

search

1pub fn search(
2&self,
3res: &Resources,
4queries: &ManagedTensor,
5neighbors: &ManagedTensor,
6distances: &ManagedTensor,
7) -> Result<()>

Perform a Nearest Neighbors search on the Index

Arguments

  • res - Resources to use
  • queries - A matrix in device memory to query for
  • neighbors - Matrix in device memory that receives the indices of the nearest neighbors
  • distances - Matrix in device memory that receives the distances of the nearest neighbors

Source: rust/cuvs/src/brute_force.rs:70

Source: rust/cuvs/src/brute_force.rs:16