Resources Module
Rust module: cuvs::resources
Source: rust/cuvs/src/resources.rs
GPU resource management with RAII semantics.
ResourcesError
Error type for resource operations.
Source: rust/cuvs/src/resources.rs:19
Resources
Resources are objects that are shared between function calls, and includes things like CUDA streams, cuBLAS handles and other resources that are expensive to create.
Methods
new
Creates a new resources handle bound to the current CUDA device.
Source: rust/cuvs/src/resources.rs:38
with_memory_tracking
Returns a new Resources object whose memory allocations are tracked
and written as CSV samples to csv_path from a background thread.
The handle wraps all reachable memory resources (host, pinned, managed, device, workspace, large_workspace) with allocation-tracking adaptors and replaces the global host and device memory resources for the lifetime of the handle. The CSV reporter is stopped and the global memory resources are restored when the handle is dropped.
sample_interval controls the minimum time between successive CSV
samples; when None, the C++ default of 10 ms is used.
Source: rust/cuvs/src/resources.rs:55
with_stream
Creates a resources handle that enqueues work on stream instead of the
default internal stream.
The stream is bound once, at construction.
Safety
stream must be a valid CUDA stream for the current device and must
remain valid for as long as this handle uses it.
Source: rust/cuvs/src/resources.rs:82
stream
Returns the current CUDA stream associated with this handle.
Source: rust/cuvs/src/resources.rs:91
sync_stream
Blocks until all operations on the current CUDA stream have completed.
Source: rust/cuvs/src/resources.rs:100
Source: rust/cuvs/src/resources.rs:32