summaryrefslogtreecommitdiff
path: root/examples/parallel.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-11-07 16:52:00 +0000
committerAlberto Ruiz <aruiz@um.es>2007-11-07 16:52:00 +0000
commit9e6500bf8e925b363e74e01834f81dde0810f808 (patch)
treea720c1e446944f649b2f21d619bf35b34411a072 /examples/parallel.hs
parent894344f9ef93a0ff5e2fb12f085b5c706b7aa9d9 (diff)
removed -O for 6.8.1
Diffstat (limited to 'examples/parallel.hs')
-rw-r--r--examples/parallel.hs28
1 files changed, 0 insertions, 28 deletions
diff --git a/examples/parallel.hs b/examples/parallel.hs
deleted file mode 100644
index 7256fb6..0000000
--- a/examples/parallel.hs
+++ /dev/null
@@ -1,28 +0,0 @@
1import System(getArgs)
2import Numeric.LinearAlgebra
3import Control.Parallel.Strategies
4import System.Time
5
6inParallel = parMap rwhnf id
7
8parMul x y = fromBlocks [inParallel[x <> y1, x <> y2]]
9 where p = cols y `div` 2
10 (y1,y2) = splitColumnsAt p y
11
12main = do
13 n <- (read . head) `fmap` getArgs
14 let m = ident n :: Matrix Double
15 time $ print $ vectorMax $ takeDiag $ parMul m m
16 time $ print $ vectorMax $ takeDiag $ m <> m
17
18a = (2><3) [1..6::Double]
19b = (3><4) [1..12::Double]
20
21splitRowsAt p m = (takeRows p m, dropRows p m)
22splitColumnsAt p m = (takeColumns p m, dropColumns p m)
23
24time act = do
25 t0 <- getClockTime
26 act
27 t1 <- getClockTime
28 print $ tdSec $ normalizeTimeDiff $ diffClockTimes t1 t0