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
  • ManagedTensor
  • as_ptr
  • to_device
  • to_host
  • IntoDtype
API ReferenceRust API Documentation

Dlpack Module

||View as Markdown|
Previous

cuVS

Next

cuVS Error

Rust module: cuvs::dlpack

Source: rust/cuvs/src/dlpack.rs

ManagedTensor

1#[derive(Debug)]
2pub struct ManagedTensor(ffi::DLManagedTensor); {
3 /* private fields */
4}

ManagedTensor is a wrapper around a dlpack DLManagedTensor object. This lets you pass matrices in device or host memory into cuvs.

Methods

NameSource
as_ptrrust/cuvs/src/dlpack.rs:21
to_devicerust/cuvs/src/dlpack.rs:27
to_hostrust/cuvs/src/dlpack.rs:47

as_ptr

1pub fn as_ptr(&self) -> *mut ffi::DLManagedTensor

Source: rust/cuvs/src/dlpack.rs:21

to_device

1pub fn to_device(&self, res: &Resources) -> Result<ManagedTensor>

Creates a new ManagedTensor on the current GPU device, and copies the data into it.

Source: rust/cuvs/src/dlpack.rs:27

to_host

1pub fn to_host<
2T: IntoDtype,
3S: ndarray::RawData<Elem = T> + ndarray::RawDataMut,
4D: ndarray::Dimension,
5>(
6&self,
7res: &Resources,
8arr: &mut ndarray::ArrayBase<S, D>,
9) -> Result<()>

Copies data from device memory into host memory

Source: rust/cuvs/src/dlpack.rs:47

Source: rust/cuvs/src/dlpack.rs:14

IntoDtype

1pub trait IntoDtype {
2 /* required methods omitted */
3}

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