diff options
Diffstat (limited to 'test/Main.hs')
| -rw-r--r-- | test/Main.hs | 12 | 
1 files changed, 10 insertions, 2 deletions
diff --git a/test/Main.hs b/test/Main.hs index 4bc9082..d586973 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -11,6 +11,7 @@  {-# LANGUAGE UndecidableInstances #-}  module Main where +import Control.Monad (when)  import Control.Monad.Trans.Class (lift)  import Control.Monad.Trans.State  import Data.Bifunctor @@ -352,7 +353,10 @@ adTestGenChad testname config env envGenerator expr exprS primalSfun | Dict <- e        dtermSChadSUS = simplifyFix $ unMonoid dtermSChadS        dtermSChadSUSP = pruneExpr env dtermSChadSUS    in -  withResource (makeFwdADArtifactCompile env exprS) (\_ -> pure ()) $ \fwdartifactC -> +  withResource' (do (fun, output) <- makeFwdADArtifactCompile env exprS +                    when (not (null output)) $ +                      outputWarningText $ "Forward AD compile GCC output: <<<\n" ++ output ++ ">>>" +                    return fun) $ \fwdartifactC ->    withCompiled env dtermSChadSUSP $ \dcompSChadSUSP ->      testProperty testname $ property $ do        annotate (concat (unSList (\t -> ppSTy 0 t ++ " -> ") env) ++ ppSTy 0 (typeOf expr)) @@ -416,7 +420,11 @@ adTestGenChad testname config env envGenerator expr exprS primalSfun | Dict <- e        diff tansCompSChadSUSP closeIshE' tansFwd  withCompiled :: SList STy env -> Ex env t -> ((SList Value env -> IO (Rep t)) -> TestTree) -> TestTree -withCompiled env expr = withResource (compile env expr) (\_ -> pure ()) +withCompiled env expr = withResource' $ do +  (fun, output) <- compile env expr +  when (not (null output)) $ +    outputWarningText $ "Kernel compilation GCC output: <<<\n" ++ output ++ ">>>" +  return fun  gen_gmm :: Gen (SList Value [R, R, R, I64, TMat R, TMat R, TMat R, TMat R, TVec R, I64, I64, I64])  gen_gmm = do  | 
