delete example and remove compiler optimisation flags

This commit is contained in:
Saurabh 2022-04-01 15:26:18 -06:00
parent 04a97bb79e
commit 2606409a02
2 changed files with 0 additions and 50 deletions

View File

@ -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"

View File

@ -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::<f64, _>(&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");
}
}