use crate::ir::Program;
use crate::ops::cpu_op::CpuFn;
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Backend {
Wgsl,
Cuda,
SpirV,
Metal,
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy)]
pub enum Category {
A,
C {
backend_availability: fn(&Backend) -> bool,
},
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy)]
pub struct IntrinsicDescriptor {
name: &'static str,
hardware: &'static str,
cpu_fn: CpuFn,
}
impl IntrinsicDescriptor {
#[must_use]
pub const fn new(name: &'static str, hardware: &'static str, cpu_fn: CpuFn) -> Self {
Self {
name,
hardware,
cpu_fn,
}
}
#[must_use]
pub const fn name(&self) -> &'static str {
self.name
}
#[must_use]
pub const fn hardware(&self) -> &'static str {
self.hardware
}
#[must_use]
pub const fn cpu_fn(&self) -> CpuFn {
self.cpu_fn
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy)]
pub enum Compose {
Composition(fn() -> Program),
Intrinsic(IntrinsicDescriptor),
}