diff --git a/juno_samples/rodinia/cfd/src/cpu_euler.sch b/juno_samples/rodinia/cfd/src/cpu_euler.sch index 1244f80e54fdad43f58e5c5a5af44646b7a83e89..4cf320a6d8f8d1245272c0855f567a1834939963 100644 --- a/juno_samples/rodinia/cfd/src/cpu_euler.sch +++ b/juno_samples/rodinia/cfd/src/cpu_euler.sch @@ -14,8 +14,8 @@ simpl!(*); inline(compute_step_factor, compute_flux, compute_flux_contribution, time_step); delete-uncalled(*); simpl!(*); -ip-sroa[false](*); -sroa[false](*); +ip-sroa[true](*); +sroa[true](*); predication(*); const-inline(*); simpl!(*); diff --git a/juno_samples/rodinia/cfd/src/cpu_pre_euler.sch b/juno_samples/rodinia/cfd/src/cpu_pre_euler.sch index 6329c5046e15ca0bce646f4a778dcf8c8d781656..14eb690641107e7e807cd24b741ecf9098553891 100644 --- a/juno_samples/rodinia/cfd/src/cpu_pre_euler.sch +++ b/juno_samples/rodinia/cfd/src/cpu_pre_euler.sch @@ -14,8 +14,8 @@ simpl!(*); inline(compute_step_factor, compute_flux, compute_flux_contributions, compute_flux_contribution, time_step); delete-uncalled(*); simpl!(*); -ip-sroa[false](*); -sroa[false](*); +ip-sroa[true](*); +sroa[true](*); predication(*); const-inline(*); simpl!(*); diff --git a/juno_samples/rodinia/cfd/src/lib.rs b/juno_samples/rodinia/cfd/src/lib.rs index 39384c0d6a322f22a7c7b7ef7e51348d80a36107..e054a6054d0cde13e0af8bf8772fd00817142eb7 100644 --- a/juno_samples/rodinia/cfd/src/lib.rs +++ b/juno_samples/rodinia/cfd/src/lib.rs @@ -55,8 +55,7 @@ fn run_euler( let ff_fc_momentum_z = HerculesImmBox::from(ff_fc_momentum_z.as_slice()); let mut runner = runner!(euler); - - HerculesMutBox::from(async_std::task::block_on(async { + let (density, x_m, y_m, z_m, energy) = async_std::task::block_on(async { runner .run( nelr as u64, @@ -72,9 +71,20 @@ fn run_euler( ff_fc_momentum_z.to(), ) .await - })) - .as_slice() - .to_vec() + }); + + let total = vec![]; + let density = HerculesMutBox::from(density).as_slice(); + let x_m = HerculesMutBox::from(x_m).as_slice(); + let y_m = HerculesMutBox::from(y_m).as_slice(); + let z_m = HerculesMutBox::from(z_m).as_slice(); + let energy = HerculesMutBox::from(energy).as_slice(); + total.extend(density.into_iter().map(|id: &mut f32| *id)); + total.extend(x_m.into_iter().map(|id: &mut f32| *id)); + total.extend(y_m.into_iter().map(|id: &mut f32| *id)); + total.extend(z_m.into_iter().map(|id: &mut f32| *id)); + total.extend(energy.into_iter().map(|id: &mut f32| *id)); + total } fn run_pre_euler( @@ -114,7 +124,7 @@ fn run_pre_euler( let variables = variables.to(); - HerculesMutBox::from(async_std::task::block_on(async { + let (density, x_m, y_m, z_m, energy) = async_std::task::block_on(async { runner .run( nelr as u64, @@ -130,9 +140,20 @@ fn run_pre_euler( ff_fc_momentum_z.to(), ) .await - })) - .as_slice() - .to_vec() + }); + + let total = vec![]; + let density = HerculesMutBox::from(density).as_slice(); + let x_m = HerculesMutBox::from(x_m).as_slice(); + let y_m = HerculesMutBox::from(y_m).as_slice(); + let z_m = HerculesMutBox::from(z_m).as_slice(); + let energy = HerculesMutBox::from(energy).as_slice(); + total.extend(density.into_iter().map(|id: &mut f32| *id)); + total.extend(x_m.into_iter().map(|id: &mut f32| *id)); + total.extend(y_m.into_iter().map(|id: &mut f32| *id)); + total.extend(z_m.into_iter().map(|id: &mut f32| *id)); + total.extend(energy.into_iter().map(|id: &mut f32| *id)); + total } fn compare_float(x: f32, y: f32) -> bool {