class device_t Every verb that takes a mask, like sz::lookup or sz::argsort, defaults to sz::default_capabilities() from <stringzilla/devices.hpp>, the enabled CPU mask, while sz::device_t::make(kind, ordinal) opens one GPU to ask its capabilities_enabled(), and sz::device_t::cpu().configure_thread(mask) wraps sz_configure_thread_cpu.
A monoversioned build keeps only its best capability, so a mask narrowed below it answers sz::status_t::missing_kernel_k.
The C guide describes the masks and the capabilities they hold.
API
Classdevice_tOne device StringZilla runs kernels on: the host CPU, or a GPU by its runtime's own ordinal.7
cpuThe host CPU, which every build has.
device_t cpu() noexcept; countHow many devices of kind the process sees: one CPU, or missing_gpu_k and zero GPUs.
expected<std::size_t> count(device_kind_t kind) noexcept; makeDevice ordinal of kind, or missing_gpu_k past the last one.
expected<device_t> make(
device_kind_t kind,
std::size_t ordinal) noexcept; capabilities_detectedWhat this device runs, whether or not this binary holds kernels for it; zero on failure.
expected<sz_capability_t> capabilities_detected() const noexcept; capabilities_compiledWhat this binary holds kernels for that this device runs; zero on failure.
expected<sz_capability_t> capabilities_compiled() const noexcept; capabilities_enabledBoth at once: the mask for this device's dispatch points; zero on failure.
expected<sz_capability_t> capabilities_enabled() const noexcept; configure_threadPrepares the calling thread for the CPU kernels of capabilities; GPUs have no such kernels, so they report missing_kernel_k.
status_t configure_thread(sz_capability_t capabilities) const noexcept; Functions
default_capabilitiesThe mask every verb dispatches over by default: the CPU's enabled capabilities, as device_t::cpu().capabilities_enabled() reports them.
sz_capability_t default_capabilities() noexcept; A monoversioned build keeps only its best capability, so a mask narrowed below it answers missing_kernel_k.