aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-10-30 20:09:10 +0100
committerTom Smeding <tom@tomsmeding.com>2025-10-30 20:09:10 +0100
commit654b13d0de961788ed600e8eeb6c9fbbd736439e (patch)
tree4821c1082aa2fcd04ea6ecb0e07f8d3bdbe643ed /test
parent4c9ae47dd5bbd27b1acb6dc5d4a55657ac1f026f (diff)
Compile foldd1 and foldd2
Diffstat (limited to 'test')
-rw-r--r--test/Main.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Main.hs b/test/Main.hs
index 2acc9f8..4bc9082 100644
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -396,7 +396,7 @@ adTestGenChad testname config env envGenerator expr exprS primalSfun | Dict <- e
-- annotate (ppExpr knownEnv expr)
-- annotate (ppExpr env dtermChad0)
-- annotate (ppExpr env dtermChadS)
- annotate (ppExpr env (simplifyFix (unMonoid dtermSChadS)))
+ annotate (ppExpr env dtermSChadSUSP)
diff outChad0 closeIsh outPrimal
diff outChadS closeIsh outPrimal
diff outChadSUS closeIsh outPrimal
@@ -562,6 +562,13 @@ tests_Compile = testGroup "Compile"
nil) $
let_ #_ (accum SAPHere nil #x #ac) $
nil
+
+ ,compileTest "foldd1" $ fromNamed $ lambda @(TVec R) #a $ body $
+ fold1iD1 (#x :-> #y :-> pair (#x * #y) (pair #x #y)) 1 #a
+
+ ,compileTest "fold-manual" $ fromNamed $ lambda @(TVec R) #a $ lambda #d $ body $
+ let_ #pr (fold1iD1 (#x :-> #y :-> pair (#x * #y) (pair #x #y)) 1 #a) $
+ fold1iD2 (#tape :-> #ctg :-> pair (snd_ #tape * #ctg) (fst_ #tape * #ctg)) (snd_ #pr) #d
]
tests_AD :: TestTree