mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-05 14:53:37 +00:00
housekeeping
This commit is contained in:
parent
7bb28f8c96
commit
e64ce375d2
|
@ -159,15 +159,17 @@ common gtk
|
|||
, gi-gtk
|
||||
>= 4.0.3 && < 4.1
|
||||
, haskell-gi
|
||||
>= 0.26 && < 0.27
|
||||
>= 0.26.10 && < 0.27
|
||||
, haskell-gi-base
|
||||
>= 0.26 && < 0.27
|
||||
>= 0.26.10 && < 0.27
|
||||
|
||||
-- Workaround for https://github.com/haskell/cabal/issues/4237
|
||||
-- See https://github.com/commercialhaskell/stack/issues/2197
|
||||
if flag(gtk-410)
|
||||
pkgconfig-depends: gtk4 >= 4.10
|
||||
cpp-options: -DMIN_VERSION_GTK_4_10
|
||||
else
|
||||
pkgconfig-depends: gtk4 < 4.10
|
||||
|
||||
library metabrushes
|
||||
|
||||
|
|
|
@ -199,11 +199,18 @@ library
|
|||
cbits/lp_2d.cpp
|
||||
cxx-options:
|
||||
-std=c++20
|
||||
-mavx2 -mfma
|
||||
-frounding-math -fno-math-errno -fno-signed-zeros
|
||||
-fno-trapping-math -fno-signaling-nans
|
||||
-Wno-unused-result -Wsign-compare -Wno-switch
|
||||
-march=native -mtune=native
|
||||
-mavx2
|
||||
-mfma
|
||||
-frounding-math
|
||||
-ffp-contract=off
|
||||
-fno-math-errno
|
||||
-fno-signed-zeros
|
||||
-fno-trapping-math
|
||||
-Wno-unused-result
|
||||
-Wno-sign-compare
|
||||
-Wno-switch
|
||||
-march=native
|
||||
-mtune=native
|
||||
-O3 -DNDEBUG
|
||||
build-depends:
|
||||
system-cxx-std-lib
|
||||
|
|
|
@ -131,6 +131,12 @@ instance Transcendental ( 𝕀 Double ) where
|
|||
sin = withHW Prelude.sin
|
||||
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 #-}
|
||||
-- | Internal function: use @rounded-hw@ to define a function on intervals.
|
||||
withHW :: (Interval.Interval a -> Interval.Interval b) -> 𝕀 a -> 𝕀 b
|
||||
|
|
|
@ -65,6 +65,10 @@ import qualified Data.List.NonEmpty as NE
|
|||
import GHC.TypeNats
|
||||
( Nat )
|
||||
|
||||
-- parallel
|
||||
--import Control.Parallel.Strategies
|
||||
-- ( Strategy, using, parTraversable, rpar )
|
||||
|
||||
-- transformers
|
||||
import Control.Monad.Trans.Writer.CPS
|
||||
( Writer, runWriter, tell )
|
||||
|
@ -248,10 +252,18 @@ isolateRootsIn ( RootIsolationOptions { rootIsolationAlgorithms } )
|
|||
-> [ Box n ]
|
||||
-> Writer ( DoneBoxes n ) [ RootIsolationTree ( Box n ) ]
|
||||
recur step r cands = do
|
||||
rest <- traverse ( \ c -> do { trees <- r c; return [ (c, tree) | tree <- trees ] } ) cands
|
||||
return [ RootIsolationStep step $ concat rest ]
|
||||
let rest :: [ ( [ ( Box n, RootIsolationTree ( Box n ) ) ], DoneBoxes n ) ]
|
||||
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 #-}
|
||||
|
||||
--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
|
||||
-- (hopefully smaller) output boxes.
|
||||
doStrategy
|
||||
|
|
|
@ -41,12 +41,6 @@ allow-newer:
|
|||
waargonaut:vector,
|
||||
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 --
|
||||
--------------
|
||||
|
|
Loading…
Reference in a new issue