Skip to main content

Module accelerate

Module accelerate 

Source
Expand description

The hardware backends kernels can run on.

An Accelerator names a backend rather than a specific piece of hardware. Which physical GPU it lands on is chosen separately, with crate::Device.

Only the backends whose crate feature is enabled exist at compile time, so a build without the cuda feature has no Accelerator::Cuda variant at all.

Denoiser::create takes a list of these and uses the first one that starts successfully, which lets a program prefer a fast backend and quietly fall back to a slower one.

use av_denoise_core::accelerate::get_default_accelerators;

// Every backend this build supports, in the order to try them.
let preferred = get_default_accelerators();

A list can also be written out by hand, such as vec![Accelerator::Cuda, Accelerator::Vulkan] to prefer the vendor backend and fall back to the portable one.

Every accelerator here runs kernels on a GPU. There is no software backend, because the collaborative filter aggregates through atomic floating-point adds and cubecl’s CPU runtime does not implement atomics. crate::Device::Cpu still selects a software device where the platform offers one, such as lavapipe under Vulkan.

Structs§

AcceleratorIter
An iterator over the variants of Accelerator

Enums§

Accelerator
A hardware backend that kernels can run on.

Functions§

get_default_accelerators
Returns every accelerator this build enables, in the order to try them.