From 654b13d0de961788ed600e8eeb6c9fbbd736439e Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 30 Oct 2025 20:09:10 +0100 Subject: Compile foldd1 and foldd2 --- test/Main.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/Main.hs') 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 -- cgit v1.2.3-70-g09d2