Skip to content

Commit

Permalink
Increse bound & debug info.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee-Janggun committed Sep 5, 2024
1 parent c58e90f commit 1f3fe51
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/assignments/assignment13/small_exercises_grade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ mod test {
assert_eq!(res_par, 55.0);

for _ in 0..5 {
let vec1 = Array::random(500_000, Uniform::new(0., 10.));
let vec2 = Array::random(500_000, Uniform::new(0., 10.));
let vec1 = Array::random(1_000_000, Uniform::new(0., 10.));
let vec2 = Array::random(1_000_000, Uniform::new(0., 10.));

let now_seq = Instant::now();
let res_seq = hint::black_box(dot_product(
Expand All @@ -134,8 +134,10 @@ mod test {
));
let elapsed_par = now_par.elapsed();

let _res = relative_eq!(res_seq, vec1.dot(&vec2), epsilon = f64::EPSILON);
let _res = relative_eq!(res_par, vec1.dot(&vec2), epsilon = f64::EPSILON);
let _ress = relative_eq!(res_seq, vec1.dot(&vec2), epsilon = f64::EPSILON);
let _resp = relative_eq!(res_par, vec1.dot(&vec2), epsilon = f64::EPSILON);
println!("Sequential: {_ress} {elapsed_seq:?}, Parallel: {_resp} {elapsed_par:?}");

assert!(elapsed_par < elapsed_seq);
}
}
Expand Down

0 comments on commit 1f3fe51

Please sign in to comment.