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

cfd is tricky

parent 0a6326e6
No related branches found
No related tags found
1 merge request!203More rodinia optimization
Pipeline #201914 failed
......@@ -24,7 +24,8 @@ fixpoint {
fork-guard-elim(*);
}
simpl!(*);
no-memset(compute_step_factor@res, compute_flux@res, copy_vars@res);
parallel-reduce(time_step, copy_vars, compute_flux@outer_loop \ compute_flux@inner_loop);
unforkify(*);
gcm(*);
......@@ -47,7 +47,7 @@ fn compute_speed_of_sound(density: f32, pressure: f32) -> f32 {
}
fn compute_step_factor<nelr: usize>(variables: Variables::<nelr>, areas: f32[nelr]) -> f32[nelr] {
let step_factors : f32[nelr];
@res let step_factors : f32[nelr];
for i in 0..nelr {
let density = variables.density[i];
......@@ -106,9 +106,9 @@ fn compute_flux<nelr: usize>(
ff_flux_contribution_momentum_z: float3,
) -> Variables::<nelr> {
const smoothing_coefficient : f32 = 0.2;
let fluxes: Variables::<nelr>;
@res let fluxes: Variables::<nelr>;
for i in 0..nelr {
@outer_loop for i in 0..nelr {
let density_i = variables.density[i];
let momentum_i = float3 { x: variables.momentum.x[i],
......@@ -131,7 +131,7 @@ fn compute_flux<nelr: usize>(
let flux_i_momentum = float3 { x: 0.0, y: 0.0, z: 0.0 };
let flux_i_density_energy : f32 = 0.0;
for j in 0..NNB {
@inner_loop for j in 0..NNB {
let nb = elements_surrounding_elements[j, i];
let normal = float3 {
x: normals.x[j, i],
......@@ -249,7 +249,7 @@ fn time_step<nelr: usize>(
}
fn copy_vars<nelr: usize>(variables: Variables::<nelr>) -> Variables::<nelr> {
let result : Variables::<nelr>;
@res let result : Variables::<nelr>;
for i in 0..nelr {
result.density[i] = variables.density[i];
......
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