diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-04-29 15:54:12 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-04-29 15:54:12 +0200 |
commit | 3fd8d35cca2a23c137934a170c67e8ce310edf13 (patch) | |
tree | 429fb99f9c1395272f1f9a94bfbc0e003fa39b21 /bench | |
parent | 919a36f8eed21501357185a90e2b7a4d9eaf7f08 (diff) |
Complete monoidal accumulator rewrite
Diffstat (limited to 'bench')
-rw-r--r-- | bench/Main.hs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/bench/Main.hs b/bench/Main.hs index af83ef7..358ba31 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -12,7 +12,6 @@ module Main where import Control.DeepSeq import Criterion.Main -import Data.Coerce import Data.Int (Int64) import Data.Kind (Constraint) import GHC.Exts (withDict) @@ -38,26 +37,6 @@ gradCHAD config term = simplifyFix $ unMonoid $ simplifyFix $ ELet ext (EConst ext STF64 1.0) $ chad' config knownEnv term -instance KnownTy t => NFData (Value t) where - rnf = \(Value x) -> go (knownTy @t) x - where - go :: STy t' -> Rep t' -> () - go STNil () = () - go (STPair a b) (x, y) = go a x `seq` go b y - go (STEither a _) (Left x) = go a x - go (STEither _ b) (Right y) = go b y - go (STMaybe _) Nothing = () - go (STMaybe t) (Just x) = go t x - go (STArr (_ :: SNat n) (t :: STy t2)) arr = - withDict @(KnownTy t2) t $ rnf (coerce @(Array n (Rep t2)) @(Array n (Value t2)) arr) - go (STScal t) x = case t of - STI32 -> rnf x - STI64 -> rnf x - STF32 -> rnf x - STF64 -> rnf x - STBool -> rnf x - go STAccum{} _ = error "Cannot rnf accumulators" - type AllNFDataRep :: [Ty] -> Constraint type family AllNFDataRep env where AllNFDataRep '[] = () |