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

Infer more indices as parallel

parent 96c8dc52
No related branches found
No related tags found
1 merge request!206More misc. rodinia opts
Pipeline #201937 passed
...@@ -532,6 +532,24 @@ where ...@@ -532,6 +532,24 @@ where
let fork_thread_id_pairs = node_indices(indices).filter_map(|id| { let fork_thread_id_pairs = node_indices(indices).filter_map(|id| {
if let Node::ThreadID { control, dimension } = nodes[id.idx()] { if let Node::ThreadID { control, dimension } = nodes[id.idx()] {
Some((control, dimension)) Some((control, dimension))
} else if let Node::Binary {
op: BinaryOperator::Add,
left: tid,
right: cons,
} = nodes[id.idx()]
&& let Node::ThreadID { control, dimension } = nodes[tid.idx()]
&& (nodes[cons.idx()].is_constant() || nodes[cons.idx()].is_dynamic_constant())
{
Some((control, dimension))
} else if let Node::Binary {
op: BinaryOperator::Add,
left: cons,
right: tid,
} = nodes[id.idx()]
&& let Node::ThreadID { control, dimension } = nodes[tid.idx()]
&& (nodes[cons.idx()].is_constant() || nodes[cons.idx()].is_dynamic_constant())
{
Some((control, dimension))
} else { } else {
None None
} }
......
...@@ -7,9 +7,9 @@ fn layer_forward<n, m: usize>(vals: f32[n + 1], weights: f32[n + 1, m + 1]) -> f ...@@ -7,9 +7,9 @@ fn layer_forward<n, m: usize>(vals: f32[n + 1], weights: f32[n + 1, m + 1]) -> f
@res let result : f32[m + 1]; @res let result : f32[m + 1];
result[0] = 1.0; result[0] = 1.0;
for j in 1..=m { @outer_loop for j in 1..=m {
let sum = 0.0; let sum = 0.0;
for k in 0..=n { @inner_loop for k in 0..=n {
sum += weights[k, j] * vals[k]; sum += weights[k, j] * vals[k];
} }
result[j] = squash(sum); result[j] = squash(sum);
......
...@@ -15,20 +15,16 @@ delete-uncalled(*); ...@@ -15,20 +15,16 @@ delete-uncalled(*);
no-memset(layer_forward@res); no-memset(layer_forward@res);
lift-dc-math(*); lift-dc-math(*);
loop-bound-canon(*); loop-bound-canon(*);
dce(*); simpl!(*);
lift-dc-math(*); lift-dc-math(*);
slf(*);
fixpoint { fixpoint {
forkify(*); forkify(*);
fork-guard-elim(*); fork-guard-elim(*);
fork-coalesce(*); fork-coalesce(*);
} }
simpl!(*);
fork-split(*); fork-split(*);
gvn(*);
phi-elim(*);
dce(*);
unforkify(*); unforkify(*);
gvn(*);
phi-elim(*);
dce(*);
gcm(*); gcm(*);
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