lucem is a set of Rust crates. To get the library through one dependency, use lucem, which
re-exports lucem-core, lucem-io, lucem-ops and lucem-ml as modules. The crates are not on
crates.io, so the pages here stand in for docs.rs: each lists every public function, type and
method with its exact signature and documentation, generated from the code.
[dependencies]
lucem = { git = "https://github.com/neuro-kitchen/lucem", features = ["wgpu"] }
A client first. Functions on the device take a CubeCL Client:
ComputeTarget::from_env()?.client()? picks the runtime named by LUCEM_RUNTIME (wgpu,
cpu, cuda, hip), or else the first one compiled in.
Data on the device. Images are DeviceArray<F> with a Shape ([y, x] or [z, y, x],
row-major). DeviceArray::from_host uploads, to_host reads back; nothing moves between host
and device unless a function says so.
Three forms of an operation.op returns a new array; op_into writes into an output you
pass (no allocation, for loops and pipelines); op_device keeps a scalar result on the device
(otsu_device) where op reads it back (otsu).
Errors are OpsResult<T> (lucem-ops), CoreResult<T> (lucem-core) and HistResult<T>
(lucem-hist); shapes are checked before any kernel runs.
The same operations by name. A pipeline (lucem-pipeline), the app and lucem run call
these functions through the operation catalog.