housekeeping

This commit is contained in:
sheaf 2024-07-29 13:39:13 +02:00
parent 7bb28f8c96
commit e64ce375d2
5 changed files with 36 additions and 15 deletions

View file

@ -159,15 +159,17 @@ common gtk
, gi-gtk , gi-gtk
>= 4.0.3 && < 4.1 >= 4.0.3 && < 4.1
, haskell-gi , haskell-gi
>= 0.26 && < 0.27 >= 0.26.10 && < 0.27
, haskell-gi-base , haskell-gi-base
>= 0.26 && < 0.27 >= 0.26.10 && < 0.27
-- Workaround for https://github.com/haskell/cabal/issues/4237 -- Workaround for https://github.com/haskell/cabal/issues/4237
-- See https://github.com/commercialhaskell/stack/issues/2197 -- See https://github.com/commercialhaskell/stack/issues/2197
if flag(gtk-410) if flag(gtk-410)
pkgconfig-depends: gtk4 >= 4.10 pkgconfig-depends: gtk4 >= 4.10
cpp-options: -DMIN_VERSION_GTK_4_10 cpp-options: -DMIN_VERSION_GTK_4_10
else
pkgconfig-depends: gtk4 < 4.10
library metabrushes library metabrushes

View file

@ -199,11 +199,18 @@ library
cbits/lp_2d.cpp cbits/lp_2d.cpp
cxx-options: cxx-options:
-std=c++20 -std=c++20
-mavx2 -mfma -mavx2
-frounding-math -fno-math-errno -fno-signed-zeros -mfma
-fno-trapping-math -fno-signaling-nans -frounding-math
-Wno-unused-result -Wsign-compare -Wno-switch -ffp-contract=off
-march=native -mtune=native -fno-math-errno
-fno-signed-zeros
-fno-trapping-math
-Wno-unused-result
-Wno-sign-compare
-Wno-switch
-march=native
-mtune=native
-O3 -DNDEBUG -O3 -DNDEBUG
build-depends: build-depends:
system-cxx-std-lib system-cxx-std-lib

View file

@ -131,6 +131,12 @@ instance Transcendental ( 𝕀 Double ) where
sin = withHW Prelude.sin sin = withHW Prelude.sin
atan = withHW Prelude.atan atan = withHW Prelude.atan
{-
TODO: consider using https://github.com/JishinMaster/simd_utils/blob/160c50f07e08d2077ae4368f0aed2f10f7173c67/simd_utils_sse_double.h#L530
for sin/cos? Or Intel SVML? Or metalibm?
-}
{-# INLINE withHW #-} {-# INLINE withHW #-}
-- | Internal function: use @rounded-hw@ to define a function on intervals. -- | Internal function: use @rounded-hw@ to define a function on intervals.
withHW :: (Interval.Interval a -> Interval.Interval b) -> 𝕀 a -> 𝕀 b withHW :: (Interval.Interval a -> Interval.Interval b) -> 𝕀 a -> 𝕀 b

View file

@ -65,6 +65,10 @@ import qualified Data.List.NonEmpty as NE
import GHC.TypeNats import GHC.TypeNats
( Nat ) ( Nat )
-- parallel
--import Control.Parallel.Strategies
-- ( Strategy, using, parTraversable, rpar )
-- transformers -- transformers
import Control.Monad.Trans.Writer.CPS import Control.Monad.Trans.Writer.CPS
( Writer, runWriter, tell ) ( Writer, runWriter, tell )
@ -248,10 +252,18 @@ isolateRootsIn ( RootIsolationOptions { rootIsolationAlgorithms } )
-> [ Box n ] -> [ Box n ]
-> Writer ( DoneBoxes n ) [ RootIsolationTree ( Box n ) ] -> Writer ( DoneBoxes n ) [ RootIsolationTree ( Box n ) ]
recur step r cands = do recur step r cands = do
rest <- traverse ( \ c -> do { trees <- r c; return [ (c, tree) | tree <- trees ] } ) cands let rest :: [ ( [ ( Box n, RootIsolationTree ( Box n ) ) ], DoneBoxes n ) ]
return [ RootIsolationStep step $ concat rest ] rest =
map ( \ c -> runWriter $ do { trees <- r c; return [ (c, tree) | tree <- trees ] } ) cands
( rest2, dones ) = unzip rest --( rest `using` myParTraversable rpar )
tell ( mconcat dones )
return [ RootIsolationStep step $ concat rest2 ]
{-# INLINEABLE isolateRootsIn #-} {-# INLINEABLE isolateRootsIn #-}
--myParTraversable :: Strategy a -> Strategy [a]
--myParTraversable _ [] = return []
--myParTraversable strat (a:as) = (a:) <$> parTraversable strat as
-- | Execute a root isolation strategy, replacing the input box with -- | Execute a root isolation strategy, replacing the input box with
-- (hopefully smaller) output boxes. -- (hopefully smaller) output boxes.
doStrategy doStrategy

View file

@ -41,12 +41,6 @@ allow-newer:
waargonaut:vector, waargonaut:vector,
waargonaut:witherable, waargonaut:witherable,
-- Fix "ERROR: couldn't find API description for GLib.time_t"
source-repository-package
type: git
location: https://github.com/sheaf/haskell-gi
tag: ec11dd69ab6a3a9f7f7e967f5f7ffa7d9206cd2a
-------------- --------------
-- GHC 9.10 -- -- GHC 9.10 --
-------------- --------------