#![feature(box_as_ptr, let_chains)]

extern crate async_std;
extern crate hercules_rt;
extern crate juno_build;

use hercules_rt::HerculesBox;

juno_build::juno!("dot");

fn main() {
    async_std::task::block_on(async {
        let a: [f32; 8] = [0.0, 1.0, 0.0, 2.0, 0.0, 3.0, 0.0, 4.0];
        let b: [f32; 8] = [0.0, 5.0, 0.0, 6.0, 0.0, 7.0, 0.0, 8.0];
        let a = HerculesBox::from_slice(&a);
        let b = HerculesBox::from_slice(&b);
        let c = dot(8, a, b).await;
        println!("{}", c);
        assert_eq!(c, 70.0);
    });
}

#[test]
fn dot_test() {
    main();
}