From 2606409a02e631c3c2cc4100bdf1240ea2e1e2f2 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 1 Apr 2022 15:26:18 -0600 Subject: [PATCH] delete example and remove compiler optimisation flags --- nalgebra-sparse/Cargo.toml | 14 ------------- nalgebra-sparse/example/spmm.rs | 36 --------------------------------- 2 files changed, 50 deletions(-) delete mode 100644 nalgebra-sparse/example/spmm.rs diff --git a/nalgebra-sparse/Cargo.toml b/nalgebra-sparse/Cargo.toml index 781d1696..bb4fdb8e 100644 --- a/nalgebra-sparse/Cargo.toml +++ b/nalgebra-sparse/Cargo.toml @@ -24,7 +24,6 @@ io = [ "pest", "pest_derive" ] slow-tests = [] [dependencies] -criterion = { version = "0.3", features = ["html_reports"] } nalgebra = { version="0.30", path = "../" } num-traits = { version = "0.2", default-features = false } proptest = { version = "1.0", optional = true } @@ -32,25 +31,12 @@ matrixcompare-core = { version = "0.1.0", optional = true } pest = { version = "2", optional = true } pest_derive = { version = "2", optional = true } serde = { version = "1.0", default-features = false, features = [ "derive" ], optional = true } -itertools = "0.10" [dev-dependencies] -itertools = "0.10" matrixcompare = { version = "0.3.0", features = [ "proptest-support" ] } nalgebra = { version="0.30", path = "../", features = ["compare"] } serde_json = "1.0" -[[example]] -name = "spmm" -required-features = ["io"] -path = "example/spmm.rs" - [package.metadata.docs.rs] # Enable certain features when building docs for docs.rs features = [ "proptest-support", "compare" ] - -[profile.release] -opt-level = 3 -lto = "fat" -codegen-units = 1 -panic = "abort" diff --git a/nalgebra-sparse/example/spmm.rs b/nalgebra-sparse/example/spmm.rs deleted file mode 100644 index 2be64735..00000000 --- a/nalgebra-sparse/example/spmm.rs +++ /dev/null @@ -1,36 +0,0 @@ -extern crate nalgebra_sparse; -use nalgebra_sparse::CsrMatrix; -use std::fs::{self, DirEntry}; -use std::io; -use std::path::Path; -use std::time::{Duration, Instant}; - -#[cfg(feature = "io")] -use nalgebra_sparse::io::load_coo_from_matrix_market_file; -fn main() { - #[cfg(feature = "io")] - { - let mut file_iter = fs::read_dir("data").unwrap(); - for f in file_iter { - println!("Benchmark file {:?}", f); - let f = f.unwrap().path(); - - if f.extension().map_or(false, |ext| ext == "mtx") { - println!("Benchmark file {:?}", f); - let sparse_input_matrix = load_coo_from_matrix_market_file::(&f).unwrap(); - let sparse_input_matrix = CsrMatrix::from(&sparse_input_matrix); - let spmm_result = &sparse_input_matrix * &sparse_input_matrix; - let now = Instant::now(); - let spmm_result = &sparse_input_matrix * &sparse_input_matrix; - let spmm_time = now.elapsed().as_millis(); - println!("SGEMM time was {}", spmm_time); - let sum: f64 = spmm_result.triplet_iter().map(|(_, _, v)| v).sum(); - println!("sum of product is {}", sum); - } - } - } - #[cfg(not(feature = "io"))] - { - panic!("Run with IO feature only"); - } -}