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
#![allow(missing_docs, unused_imports, unused_variables, unreachable_patterns, clippy::all)]
// Unit tests extracted from ops/graph/csr.rs.
use crate::ops::graph::csr::{to_csr, try_to_csr};
#[test]
pub fn serializes_edges_by_source_order() -> crate::error::Result<()> {
    let csr = to_csr(4, &[(0, 2), (0, 1), (2, 3)])?;
    assert_eq!(csr.offsets, vec![0, 2, 2, 3, 3]);
    assert_eq!(csr.targets, vec![2, 1, 3]);
    assert_eq!(csr.node_data, vec![0, 0, 0, 0]);
    Ok(())
}

#[test]
pub fn rejects_invalid_edges_in_checked_api() {
    let error = try_to_csr(2, &[(0, 2)]).expect_err("invalid target must fail");
    assert!(error.to_string().contains("Fix:"));
}