Skip to main content

Module device

Module device 

Source
Expand description

Device selection for the candle-backed inner loops.

Picks CUDA when the crate was built with the cuda feature and a GPU is actually present at runtime; falls back to CPU otherwise. The choice is made once on first call and cached for the rest of the process — every subsequent tensor allocation lands on the same device, so there are no surprise host↔device transfers in the middle of a tight loop.

Callers shouldn’t need to think about devices in normal use: default_device() returns whatever’s right for this build.

Functions§

default_device
Return the device docbert-plaid uses for all tensor compute.