vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub fn split_id_into_path(id: &str) -> Result<(&str, &str, &str), String> {
    let mut parts = id.split('.');
    let family = parts
        .next()
        .ok_or_else(|| format!("Fix: id `{id}` is empty"))?;
    let subfamily = parts
        .next()
        .ok_or_else(|| format!("Fix: id `{id}` must be <family>.<subfamily>.<name>"))?;
    let name = parts
        .next()
        .ok_or_else(|| format!("Fix: id `{id}` must be <family>.<subfamily>.<name>"))?;
    if parts.next().is_some() {
        return Err(format!(
            "Fix: id `{id}` must be <family>.<subfamily>.<name> for generator output."
        ));
    }
    Ok((family, subfamily, name))
}