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

Handle outputs

parent 263b2e0c
No related branches found
No related tags found
1 merge request!208IP SROA Parameters
Pipeline #201954 failed
...@@ -14,8 +14,8 @@ simpl!(*); ...@@ -14,8 +14,8 @@ simpl!(*);
inline(compute_step_factor, compute_flux, compute_flux_contribution, time_step); inline(compute_step_factor, compute_flux, compute_flux_contribution, time_step);
delete-uncalled(*); delete-uncalled(*);
simpl!(*); simpl!(*);
ip-sroa[false](*); ip-sroa[true](*);
sroa[false](*); sroa[true](*);
predication(*); predication(*);
const-inline(*); const-inline(*);
simpl!(*); simpl!(*);
......
...@@ -14,8 +14,8 @@ simpl!(*); ...@@ -14,8 +14,8 @@ simpl!(*);
inline(compute_step_factor, compute_flux, compute_flux_contributions, compute_flux_contribution, time_step); inline(compute_step_factor, compute_flux, compute_flux_contributions, compute_flux_contribution, time_step);
delete-uncalled(*); delete-uncalled(*);
simpl!(*); simpl!(*);
ip-sroa[false](*); ip-sroa[true](*);
sroa[false](*); sroa[true](*);
predication(*); predication(*);
const-inline(*); const-inline(*);
simpl!(*); simpl!(*);
......
...@@ -55,8 +55,7 @@ fn run_euler( ...@@ -55,8 +55,7 @@ fn run_euler(
let ff_fc_momentum_z = HerculesImmBox::from(ff_fc_momentum_z.as_slice()); let ff_fc_momentum_z = HerculesImmBox::from(ff_fc_momentum_z.as_slice());
let mut runner = runner!(euler); let mut runner = runner!(euler);
let (density, x_m, y_m, z_m, energy) = async_std::task::block_on(async {
HerculesMutBox::from(async_std::task::block_on(async {
runner runner
.run( .run(
nelr as u64, nelr as u64,
...@@ -72,9 +71,20 @@ fn run_euler( ...@@ -72,9 +71,20 @@ fn run_euler(
ff_fc_momentum_z.to(), ff_fc_momentum_z.to(),
) )
.await .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( fn run_pre_euler(
...@@ -114,7 +124,7 @@ fn run_pre_euler( ...@@ -114,7 +124,7 @@ fn run_pre_euler(
let variables = variables.to(); 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 runner
.run( .run(
nelr as u64, nelr as u64,
...@@ -130,9 +140,20 @@ fn run_pre_euler( ...@@ -130,9 +140,20 @@ fn run_pre_euler(
ff_fc_momentum_z.to(), ff_fc_momentum_z.to(),
) )
.await .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 { fn compare_float(x: f32, y: f32) -> bool {
......
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