use super::ConformDispatchConfig;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ExecutionModelKind {
OneShot,
}
impl ExecutionModelKind {
pub const fn as_str(self) -> &'static str {
match self {
Self::OneShot => "OneShot",
}
}
}
#[derive(Clone, Debug)]
pub struct OneShotDispatch {
pub wgsl: String,
pub input: Vec<u8>,
pub output_size: usize,
pub config: ConformDispatchConfig,
}
#[derive(Clone, Debug)]
pub enum ExecutionModel {
OneShot(OneShotDispatch),
}
impl ExecutionModel {
pub const fn kind(&self) -> ExecutionModelKind {
match self {
Self::OneShot(_) => ExecutionModelKind::OneShot,
}
}
#[inline]
pub(crate) fn kind_name(&self) -> &'static str {
self.kind().as_str()
}
}
#[inline]
pub fn unsupported_execution_model_error(backend_name: &str, model_name: &str) -> String {
format!(
"unsupported execution model {model_name} on backend {backend_name}. Fix: this backend does not support {model_name} dispatch; see supported_models()"
)
}