diff --git a/hercules_cg/src/rt.rs b/hercules_cg/src/rt.rs index 090253d49ebbedae08318d84a2e4ef02e61e0166..f758fed34daa5359d767ae7b30c7e8b893d9040f 100644 --- a/hercules_cg/src/rt.rs +++ b/hercules_cg/src/rt.rs @@ -533,7 +533,7 @@ impl<'a> RTContext<'a> { { write!(block, "backing_{}.byte_add(", device.name())?; self.codegen_dynamic_constant(offset, block)?; - write!(block, "), ")? + write!(block, " as usize), ")? } for dc in dynamic_constants { self.codegen_dynamic_constant(*dc, block)?; diff --git a/juno_samples/cava/src/cava.jn b/juno_samples/cava/src/cava.jn index 720629e72b5e5085e7137d88302e54ef564c6ef7..de21ba78d5fc511fcef122b633c37fcee1b242bc 100644 --- a/juno_samples/cava/src/cava.jn +++ b/juno_samples/cava/src/cava.jn @@ -213,5 +213,6 @@ fn cava<r, c, num_ctrl_pts : usize>( let transf = transform::<r, c>(denosd, TsTw); let gamutd = gamut::<r, c, num_ctrl_pts>(transf, ctrl_pts, weights, coefs); let tonemd = tone_map::<r, c>(gamutd, tonemap); - return descale::<r, c>(tonemd); + let dscald = descale::<r, c>(tonemd); + return dscald; } diff --git a/juno_samples/cava/src/cpu.sch b/juno_samples/cava/src/cpu.sch index b0479f5c157846d2f1d0bf3da541672979544a65..c75260ca0f10a5920598a9a37586446a7c950880 100644 --- a/juno_samples/cava/src/cpu.sch +++ b/juno_samples/cava/src/cpu.sch @@ -43,13 +43,8 @@ fixpoint { simpl!(fuse2); array-slf(fuse2); simpl!(fuse2); -array-slf(fuse2); -simpl!(fuse2); -xdot[true](fuse2); +unforkify(fuse2); -gcm(*); -fixpoint { - float-collections(*); - dce(*); - gcm(*); -} +delete-uncalled(*); + +gcm(*); \ No newline at end of file diff --git a/juno_samples/cava/src/main.rs b/juno_samples/cava/src/main.rs index a940d6eba50b76e8e64fed3417cd12e0df5b535d..700b74e63f5903ea02c0a1028f133c7136c53ce4 100644 --- a/juno_samples/cava/src/main.rs +++ b/juno_samples/cava/src/main.rs @@ -19,24 +19,31 @@ juno_build::juno!("cava"); // Individual lifetimes are not needed in this example but should probably be generated for // flexibility async fn safe_run<'a, 'b: 'a, 'c: 'a, 'd: 'a, 'e: 'a, 'f: 'a, 'g: 'a>( - runner: &'a mut HerculesRunner_cava, r: u64, c: u64, num_ctrl_pts: u64, - input: &'b HerculesImmBox<'b, u8>, tstw: &'c HerculesImmBox<'c, f32>, - ctrl_pts: &'d HerculesImmBox<'d, f32>, weights: &'e HerculesImmBox<'e, f32>, - coefs: &'f HerculesImmBox<'f, f32>, tonemap: &'g HerculesImmBox<'g, f32>, + runner: &'a mut HerculesRunner_cava, + r: u64, + c: u64, + num_ctrl_pts: u64, + input: &'b HerculesImmBox<'b, u8>, + tstw: &'c HerculesImmBox<'c, f32>, + ctrl_pts: &'d HerculesImmBox<'d, f32>, + weights: &'e HerculesImmBox<'e, f32>, + coefs: &'f HerculesImmBox<'f, f32>, + tonemap: &'g HerculesImmBox<'g, f32>, ) -> HerculesMutBox<'a, u8> { HerculesMutBox::from( - runner.run( - r, - c, - num_ctrl_pts, - input.to(), - tstw.to(), - ctrl_pts.to(), - weights.to(), - coefs.to(), - tonemap.to() - ) - .await + runner + .run( + r, + c, + num_ctrl_pts, + input.to(), + tstw.to(), + ctrl_pts.to(), + weights.to(), + coefs.to(), + tonemap.to(), + ) + .await, ) } @@ -68,16 +75,17 @@ fn run_cava( let mut r = runner!(cava); async_std::task::block_on(async { - safe_run(&mut r, - rows as u64, - cols as u64, - num_ctrl_pts as u64, - &image, - &tstw, - &ctrl_pts, - &weights, - &coefs, - &tonemap, + safe_run( + &mut r, + rows as u64, + cols as u64, + num_ctrl_pts as u64, + &image, + &tstw, + &ctrl_pts, + &weights, + &coefs, + &tonemap, ) .await }) @@ -159,7 +167,10 @@ fn cava_harness(args: CavaInputs) { tonemap, } = load_cam_model(cam_model, CHAN).expect("Error loading camera model"); - println!("Running cava with {} rows, {} columns, and {} control points.", rows, cols, num_ctrl_pts); + println!( + "Running cava with {} rows, {} columns, and {} control points.", + rows, cols, num_ctrl_pts + ); let result = run_cava( rows, cols, @@ -229,6 +240,7 @@ fn cava_test_small() { } #[test] +#[ignore] fn cava_test_full() { cava_harness(CavaInputs { input: "examples/raw_tulips.bin".to_string(),