Skip to content
Snippets Groups Projects
Commit fd863925 authored by Russel Arbore's avatar Russel Arbore
Browse files

i am very sad

parent 966a8cc4
No related branches found
No related tags found
1 merge request!190Set up cava benchmark
Pipeline #201769 failed
......@@ -12,9 +12,9 @@ fn main() {
const I: usize = 256;
const J: usize = 64;
const K: usize = 128;
let a: Box<[f32]> = (0..I * J).map(|_| random::<f32>()).collect();
let b: Box<[f32]> = (0..J * K).map(|_| random::<f32>()).collect();
let mut correct_c: Box<[f32]> = (0..I * K).map(|_| 0.0).collect();
let a: Box<[i32]> = (0..I * J).map(|_| random::<i32>() % 100).collect();
let b: Box<[i32]> = (0..J * K).map(|_| random::<i32>() % 100).collect();
let mut correct_c: Box<[i32]> = (0..I * K).map(|_| 0).collect();
for i in 0..I {
for k in 0..K {
for j in 0..J {
......@@ -25,10 +25,8 @@ fn main() {
let a = HerculesImmBox::from(a.as_ref());
let b = HerculesImmBox::from(b.as_ref());
let mut r = runner!(matmul);
let mut c = HerculesMutBox::from(r.run(I as u64, J as u64, K as u64, a.to(), b.to()).await);
for (calc, correct) in zip(c.as_slice().into_iter().map(|x: &mut f32| *x), correct_c) {
assert!((calc - correct).abs() < 0.0001, "{} != {}", calc, correct);
}
let mut c: HerculesMutBox<i32> = HerculesMutBox::from(r.run(I as u64, J as u64, K as u64, a.to(), b.to()).await);
assert_eq!(c.as_slice(), correct_c.as_ref());
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment