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

srad cpu schedule

parent 99b1d294
No related branches found
No related tags found
1 merge request!202Round 1 of rodinia schedule optimization
Pipeline #201902 failed
......@@ -13,6 +13,8 @@ fn main() {
JunoCompiler::new()
.file_in_src("srad.jn")
.unwrap()
.schedule_in_src("cpu.sch")
.unwrap()
.build()
.unwrap();
}
macro simpl!(X) {
ccp(X);
simplify-cfg(X);
lift-dc-math(X);
gvn(X);
phi-elim(X);
dce(X);
infer-schedules(X);
}
phi-elim(*);
let loop1 = outline(srad@loop1);
let loop2 = outline(srad@loop2);
let loop3 = outline(srad@loop3);
simpl!(*);
const-inline(*);
crc(*);
slf(*);
write-predication(*);
simpl!(*);
predication(*);
simpl!(*);
predication(*);
simpl!(*);
fixpoint {
forkify(*);
fork-guard-elim(*);
fork-coalesce(*);
}
simpl!(*);
fork-split(*);
unforkify(*);
gcm(*);
......@@ -38,7 +38,7 @@ fn srad<nrows, ncols: usize>(
// These loops should really be interchanged, but they aren't in the
// Rodinia source (though they are in the HPVM source)
for i in 0..nrows {
@loop1 for i in 0..nrows {
for j in 0..ncols {
let tmp = image[j, i];
sum += tmp;
......@@ -57,7 +57,7 @@ fn srad<nrows, ncols: usize>(
let c : f32[ncols, nrows];
for j in 0..ncols {
@loop2 for j in 0..ncols {
for i in 0..nrows {
let Jc = image[j, i];
dN[j, i] = image[j, iN[i] as u64] - Jc;
......@@ -75,14 +75,15 @@ fn srad<nrows, ncols: usize>(
let qsqr = num / (den * den);
let den = (qsqr - q0sqr) / (q0sqr * (1 + q0sqr));
c[j, i] = 1.0 / (1.0 + den);
let val = 1.0 / (1.0 + den);
if c[j, i] < 0 { c[j, i] = 0; }
else if c[j, i] > 1 { c[j, i] = 1; }
if val < 0 { c[j, i] = 0; }
else if val > 1 { c[j, i] = 1; }
else { c[j, i] = val; }
}
}
for j in 0..ncols {
@loop3 for j in 0..ncols {
for i in 0..nrows {
let cN = c[j, i];
let cS = c[j, iS[i] as u64];
......
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