Skip to content

Commit

Permalink
addv example
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastacyclop committed May 14, 2024
1 parent 26090e2 commit bce46e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
19 changes: 16 additions & 3 deletions float-safe-optimizer/Optimize.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,32 @@ object Optimize {
val rules = {
import rise.eqsat.rules._
Seq(
mapFusion,
// implementation choices:
reduceSeq,
mapSeq,
// satisfying read/write annotations:
mapSeqArray,
// simplifications:
mapFusion,
reduceSeqMapFusion,
removeTransposePair,
fstReduction,
sndReduction,
/* maybe:
omp.mapPar --> need heuristic vs mapSeq
toMemAfterMapSeq
toMemAfterMapSeq / storeToMem
storeToMem
reduceSeqMapFusion
reduceSeqUnroll --> need heuristic
mapSeqUnroll/reduceSeqUnroll --> need heuristic
eliminateMapIdentity
is it worth the cost?:
betaExtract
betaNatExtract
eta
not generic enough, use Elevate passes or custom applier?:
idxReduction_i_n
*/
)
}
Expand Down
4 changes: 4 additions & 0 deletions float-safe-optimizer/examples/addv.rise
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
depFun((n: Nat) => depFun((m: Nat) => depFun((o: Nat) =>
fun(((n+o)`.`i32) ->: ((m+o)`.`i32) ->: (o`.`i32))((a, b) =>
zip(take(o)(a))(take(o)(b)) |> map(fun(x => fst(x) + snd(x)))
))))

0 comments on commit bce46e4

Please sign in to comment.