diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-03-18 22:32:16 +0100 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-03-18 22:32:16 +0100 |
commit | cb758277b3fa2d74551c45340b8ff0539713078c (patch) | |
tree | 4adb951118b70613b49f638c539282a8d28da2f0 /bench/Main.hs | |
parent | 27c2823387b21e8ed801e4d8eeb0b3e5588a2920 (diff) |
Arith statistics collection from C
Diffstat (limited to 'bench/Main.hs')
-rw-r--r-- | bench/Main.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bench/Main.hs b/bench/Main.hs index 7f1cbad..6e83270 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -3,6 +3,7 @@ {-# LANGUAGE TypeApplications #-} module Main where +import Control.Exception (bracket) import Data.Array.RankedS qualified as RS import Data.Vector.Storable qualified as VS import Numeric.LinearAlgebra qualified as LA @@ -11,6 +12,7 @@ import Test.Tasty.Bench import Data.Array.Nested import Data.Array.Nested.Internal.Mixed (mliftPrim, mliftPrim2) import Data.Array.Nested.Internal.Ranked (liftRanked1, liftRanked2) +import qualified Data.Array.Mixed.Internal.Arith as Arith enableMisc :: Bool @@ -22,7 +24,14 @@ bgroupIf False = \name _ -> bgroup name [] main :: IO () -main = defaultMain +main = + bracket (Arith.statisticsEnable False) + (\() -> do Arith.statisticsEnable False + Arith.statisticsPrintAll) + (\() -> main_tests) + +main_tests :: IO () +main_tests = defaultMain [bgroup "Num" [bench "sum(+) Double [1e6]" $ let n = 1_000_000 |