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
    • Go API Documentation
      • cuVS
      • Brute Force
      • Cagra
      • IVF Flat
      • IVF PQ
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
  • Types
  • BruteForceIndex
  • Functions
  • BuildIndex
  • Arguments
  • CreateIndex
  • SearchIndex
  • Arguments
  • Methods
  • BruteForceIndex.Close
API ReferenceGo API Documentation

Brute Force Package

||View as Markdown|
Previous

cuVS

Next

Cagra

Go package: brute_force

Sources: go/brute_force

Types

BruteForceIndex

1type BruteForceIndex struct {
2 // contains filtered or unexported fields
3}

Brute Force KNN Index

Source: go/brute_force/brute_force.go:14

Functions

BuildIndex

1func BuildIndex[T any](Resources cuvs.Resource, Dataset *cuvs.Tensor[T], metric cuvs.Distance, metric_arg float32, index *BruteForceIndex) error

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

Arguments

  • Resources - Resources to use
  • Dataset - A row-major matrix on either the host or device to index
  • metric - Distance type to use for building the index
  • metric_arg - Value of p for Minkowski distances - set to 2.0 if not applicable

Source: go/brute_force/brute_force.go:48

CreateIndex

1func CreateIndex() (*BruteForceIndex, error)

Creates a new empty Brute Force KNN Index

Source: go/brute_force/brute_force.go:20

SearchIndex

1func SearchIndex[T any](resources cuvs.Resource, index BruteForceIndex, queries *cuvs.Tensor[T], neighbors *cuvs.Tensor[int64], distances *cuvs.Tensor[float32]) error

Perform a Nearest Neighbors search on the Index

Arguments

  • Resources - Resources to use
  • queries - Tensor in device memory to query for
  • neighbors - Tensor in device memory that receives the indices of the nearest neighbors
  • distances - Tensor in device memory that receives the distances of the nearest neighbors

Source: go/brute_force/brute_force.go:72

Methods

BruteForceIndex.Close

1func (index *BruteForceIndex) Close() error

Destroys the Brute Force KNN Index

Source: go/brute_force/brute_force.go:32