1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! 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`](crate::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.
//!
//! ```no_run
//! use av_denoise::accelerate::get_default_accelerators;
//!
//! // Every backend this build supports, in the order to try them.
//! let preferred = get_default_accelerators();
//! # let _ = preferred;
//! ```
//!
//! 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.
use ;
/// A hardware backend that kernels can run on.
/// Returns every accelerator this build enables, in the order to try
/// them.