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
This commit is part of merge request !206. Comments created here will be created in the context of that merge request.
......@@ -532,6 +532,24 @@ where
let fork_thread_id_pairs = node_indices(indices).filter_map(|id| {
if let Node::ThreadID { control, dimension } = nodes[id.idx()] {
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 {
None
}
......
......@@ -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];
result[0] = 1.0;
for j in 1..=m {
@outer_loop for j in 1..=m {
let sum = 0.0;
for k in 0..=n {
@inner_loop for k in 0..=n {
sum += weights[k, j] * vals[k];
}
result[j] = squash(sum);
......
......@@ -15,20 +15,16 @@ delete-uncalled(*);
no-memset(layer_forward@res);
lift-dc-math(*);
loop-bound-canon(*);
dce(*);
simpl!(*);
lift-dc-math(*);
slf(*);
fixpoint {
forkify(*);
fork-guard-elim(*);
fork-coalesce(*);
}
simpl!(*);
fork-split(*);
gvn(*);
phi-elim(*);
dce(*);
unforkify(*);
gvn(*);
phi-elim(*);
dce(*);
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