From 4863cdb1a7495547f05e068f3f8228dae4e57f1f Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 15 Oct 2009 10:13:24 +0000 Subject: NFData instances --- examples/parallel.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'examples/parallel.hs') diff --git a/examples/parallel.hs b/examples/parallel.hs index dfbfd88..8653bc3 100644 --- a/examples/parallel.hs +++ b/examples/parallel.hs @@ -1,14 +1,17 @@ +-- $ runhaskell parallel.hs 2000 + import System(getArgs) import Numeric.LinearAlgebra import Control.Parallel.Strategies import System.Time -inParallel = parMap rwhnf id +inParallel = parMap rnf id +-- rwhnf also works in this case +-- matrix product decomposed into p parallel subtasks parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] where ys = splitColumns p y - main = do n <- (read . head) `fmap` getArgs let m = ident n :: Matrix Double -- cgit v1.2.3