From e80b2593edc3d216905279ebcfa797593a1efbfc Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 26 May 2024 14:57:34 +0200 Subject: Fast Fractional ops via C code --- bench/Main.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bench/Main.hs') diff --git a/bench/Main.hs b/bench/Main.hs index c4d2879..8f3b670 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -20,6 +20,10 @@ main = defaultMain let n = 1_000_000 in nf (\(a, b) -> runScalar (rsumOuter1 (arithPromoteRanked2 (mliftPrim2 (*)) a b))) (riota @Double n, riota n) + ,bench "sum(/) Double [1e6]" $ + let n = 1_000_000 + in nf (\(a, b) -> runScalar (rsumOuter1 (arithPromoteRanked2 (mliftPrim2 (/)) a b))) + (riota @Double n, riota n) ,bench "sum Double [1e6]" $ let n = 1_000_000 in nf (\a -> runScalar (rsumOuter1 a)) @@ -34,6 +38,10 @@ main = defaultMain let n = 1_000_000 in nf (\(a, b) -> runScalar (rsumOuter1 (a * b))) (riota @Double n, riota n) + ,bench "sum(/) Double [1e6]" $ + let n = 1_000_000 + in nf (\(a, b) -> runScalar (rsumOuter1 (a / b))) + (riota @Double n, riota n) ,bench "sum Double [1e6]" $ let n = 1_000_000 in nf (\a -> runScalar (rsumOuter1 a)) @@ -50,6 +58,11 @@ main = defaultMain in nf (\(a, b) -> LA.sumElements (a * b)) (LA.linspace @Double n (0.0, fromIntegral (n - 1)) ,LA.linspace @Double n (0.0, fromIntegral (n - 1))) + ,bench "sum(/) Double [1e6]" $ + let n = 1_000_000 + in nf (\(a, b) -> LA.sumElements (a / b)) + (LA.linspace @Double n (0.0, fromIntegral (n - 1)) + ,LA.linspace @Double n (0.0, fromIntegral (n - 1))) ,bench "sum Double [1e6]" $ let n = 1_000_000 in nf (\a -> LA.sumElements a) -- cgit v1.2.3-70-g09d2