repa-examples 3.2.1.1 → 3.2.2.1
raw patch · 2 files changed
+23/−25 lines, 2 filesdep ~basedep ~template-haskell
Dependency ranges changed: base, template-haskell
Files
- examples/Canny/src-repa/Main.hs +11/−13
- repa-examples.cabal +12/−12
examples/Canny/src-repa/Main.hs view
@@ -117,16 +117,15 @@ timeStage loops name fn = do let burn !n- = do arr <- fn- arr `deepSeqArray` return ()+ = do !arr <- fn if n <= 1 then return arr else burn (n - 1) traceEventIO $ "**** Stage " P.++ name P.++ " begin." (arrResult, t)- <- time $ do arrResult' <- burn loops- arrResult' `deepSeqArray` return arrResult'+ <- time $ do !arrResult' <- burn loops+ return arrResult' traceEventIO $ "**** Stage " P.++ name P.++ " end." @@ -140,7 +139,7 @@ ------------------------------------------------------------------------------- -- | RGB to greyscale conversion.-toGreyScale :: Monad m => Image (Word8, Word8, Word8) -> m (Image Float)+toGreyScale :: Image (Word8, Word8, Word8) -> IO (Image Float) toGreyScale arr = computeP $ R.map (* 255)@@ -149,7 +148,7 @@ -- | Separable Gaussian blur in the X direction.-blurSepX :: Monad m => Image Float -> m (Image Float)+blurSepX :: Image Float -> IO (Image Float) blurSepX arr = computeP $ forStencil2 BoundClamp arr@@ -158,7 +157,7 @@ -- | Separable Gaussian blur in the Y direction.-blurSepY :: Monad m => Image Float -> m (Image Float)+blurSepY :: Image Float -> IO (Image Float) blurSepY arr = computeP $ R.smap (/ 256)@@ -172,7 +171,7 @@ -- | Compute gradient in the X direction.-gradientX :: Monad m => Image Float -> m (Image Float)+gradientX :: Image Float -> IO (Image Float) gradientX img = computeP $ forStencil2 BoundClamp img@@ -183,7 +182,7 @@ -- | Compute gradient in the Y direction.-gradientY :: Monad m => Image Float -> m (Image Float)+gradientY :: Image Float -> IO (Image Float) gradientY img = computeP $ forStencil2 BoundClamp img@@ -195,8 +194,7 @@ -- | Classify the magnitude and orientation of the vector gradient. gradientMagOrient - :: Monad m - => Float -> Image Float -> Image Float -> m (Image (Float, Word8))+ :: Float -> Image Float -> Image Float -> IO (Image (Float, Word8)) gradientMagOrient !threshLow dX dY = computeP@@ -255,7 +253,7 @@ -- | Suppress pixels that are not local maxima, and use the magnitude to classify maxima -- into strong and weak (potential) edges.-suppress :: Monad m => Float -> Float -> Image (Float, Word8) -> m (Image Word8)+suppress :: Float -> Float -> Image (Float, Word8) -> IO (Image Word8) suppress !threshLow !threshHigh !dMagOrient = computeP $ makeBordered2 @@ -293,7 +291,7 @@ -- TODO: If would better if we could medge this into the above stage, and -- record the strong edge during non-maximum suppression, but Repa -- doesn't provide a fused mapFilter primitive yet.-selectStrong :: Monad m => Image Word8 -> m (Array U DIM1 Int)+selectStrong :: Image Word8 -> IO (Array U DIM1 Int) selectStrong img = let vec = toUnboxed img
repa-examples.cabal view
@@ -1,5 +1,5 @@ Name: repa-examples-Version: 3.2.1.1+Version: 3.2.2.1 License: BSD3 License-file: LICENSE Author: The DPH Team@@ -19,10 +19,10 @@ Executable repa-canny Build-depends: - base == 4.*,+ base == 4.6.*, repa == 3.2.*, repa-algorithms == 3.2.*,- template-haskell >= 2.5 && < 2.8+ template-haskell == 2.8.* Main-is: examples/Canny/src-repa/Main.hs hs-source-dirs: examples/Canny/src-repa .@@ -36,7 +36,7 @@ Executable repa-mmult Build-depends: - base == 4.*,+ base == 4.6.*, random == 1.0.*, repa == 3.2.*, repa-io == 3.2.*,@@ -57,7 +57,7 @@ Executable repa-laplace Build-depends: - base == 4.*,+ base == 4.6.*, repa == 3.2.*, repa-io == 3.2.* @@ -74,7 +74,7 @@ Executable repa-fft2d Build-depends: - base == 4.*,+ base == 4.6.*, repa == 3.2.*, repa-algorithms == 3.2.*, repa-io == 3.2.*@@ -93,7 +93,7 @@ Executable repa-fft2d-highpass Build-depends: - base == 4.*,+ base == 4.6.*, repa == 3.2.*, repa-algorithms == 3.2.*, repa-io == 3.2.*@@ -113,7 +113,7 @@ Executable repa-fft3d-highpass Build-depends: - base == 4.*,+ base == 4.6.*, repa == 3.2.*, repa-algorithms == 3.2.* @@ -131,7 +131,7 @@ Executable repa-blur Build-depends: - base == 4.*,+ base == 4.6.*, vector == 0.9.*, repa == 3.2.*, repa-algorithms == 3.2.*@@ -150,8 +150,8 @@ Executable repa-sobel Build-depends: - base == 4.*,- template-haskell >= 2.5 && < 2.8,+ base == 4.6.*,+ template-haskell == 2.8.*, repa == 3.2.*, repa-algorithms == 3.2.* @@ -170,7 +170,7 @@ Executable repa-volume Build-depends: - base == 4.*,+ base == 4.6.*, repa == 3.2.*, repa-io == 3.2.*