summaryrefslogtreecommitdiff
path: root/examples/parallel.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-10-15 10:31:45 +0000
committerAlberto Ruiz <aruiz@um.es>2007-10-15 10:31:45 +0000
commit9adf5ded237339dbe41db6c486993c4547396a22 (patch)
treeec36572020d515ffdec785e0f661ef57754a5220 /examples/parallel.hs
parent9d2073dd2cf7873006b0e831754928f7c0be52b7 (diff)
some windows support
Diffstat (limited to 'examples/parallel.hs')
-rw-r--r--examples/parallel.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/parallel.hs b/examples/parallel.hs
index 8f67863..7256fb6 100644
--- a/examples/parallel.hs
+++ b/examples/parallel.hs
@@ -5,11 +5,9 @@ import System.Time
5 5
6inParallel = parMap rwhnf id 6inParallel = parMap rwhnf id
7 7
8parMul x y = fromBlocks [[ay],[by]] 8parMul x y = fromBlocks [inParallel[x <> y1, x <> y2]]
9 where p = rows x `div` 2 9 where p = cols y `div` 2
10 a = takeRows p x 10 (y1,y2) = splitColumnsAt p y
11 b = dropRows p x
12 [ay,by] = inParallel [a<>y,b<>y]
13 11
14main = do 12main = do
15 n <- (read . head) `fmap` getArgs 13 n <- (read . head) `fmap` getArgs
@@ -20,6 +18,9 @@ main = do
20a = (2><3) [1..6::Double] 18a = (2><3) [1..6::Double]
21b = (3><4) [1..12::Double] 19b = (3><4) [1..12::Double]
22 20
21splitRowsAt p m = (takeRows p m, dropRows p m)
22splitColumnsAt p m = (takeColumns p m, dropColumns p m)
23
23time act = do 24time act = do
24 t0 <- getClockTime 25 t0 <- getClockTime
25 act 26 act