Go · Residency

Residency

import "github.com/unum-cloud/USearch/golang" 3.0.0-rc.1 · 4c3e5023

Where the payload lives is the constructor’s name, as in the C lifecycle verbs, so a residency an index lacks has no constructor to call. Each takes only the placement its own hardware has, one shard per entry, and an empty list derives it.

inRam, err := usearch.DenseInitRam(options, []int32{0, 1})        // one graph per socket
inVram, err := usearch.DenseInitVram(options, []int32{0, 1, 2, 3}) // sharded, never replicated
onGpu, err := usearch.DenseLoadVram("index.safegraphs", &usearch.DenseLoadVramConfig{Devices: []int32{0}})

An NVMe index is only ever viewed: external-memory graphs are never modified in place.

API

EnumResidencyResidency is where a handle keeps its payload, and where an executor computes and places the arenas it makes.1
types.go:582 ↗
type Residency int32

Values

ResidencyRamResidencyRam is volatile host memory, traversed by CPU threads.
ResidencyVramResidencyVram is accelerator memory, traversed by GPU warps on a chosen device.
ResidencyNvmeResidencyNvme is persisted storage, traversed through pluggable I/O engines and sized past RAM.
StringString renders the residency as the library spells it.
types.go:594 ↗
func (residency Residency) String() string