diff options
Diffstat (limited to 'examples/parallel.hs')
-rw-r--r-- | examples/parallel.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/parallel.hs b/examples/parallel.hs index efcbe8a..3c83c54 100644 --- a/examples/parallel.hs +++ b/examples/parallel.hs | |||
@@ -12,10 +12,13 @@ inParallel = parMap rwhnf id | |||
12 | parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] | 12 | parMul p x y = fromBlocks [ inParallel ( map (x <>) ys ) ] |
13 | where ys = splitColumns p y | 13 | where ys = splitColumns p y |
14 | 14 | ||
15 | -- x <||> y = fromColumns . inParallel . map (x <>) . toColumns $ y | ||
16 | |||
15 | main = do | 17 | main = do |
16 | n <- (read . head) `fmap` getArgs | 18 | n <- (read . head) `fmap` getArgs |
17 | let m = ident n :: Matrix Double | 19 | let m = ident n :: Matrix Double |
18 | time $ print $ vectorMax $ takeDiag $ m <> m | 20 | time $ print $ vectorMax $ takeDiag $ m <> m |
21 | -- time $ print $ vectorMax $ takeDiag $ m <||> m | ||
19 | time $ print $ vectorMax $ takeDiag $ parMul 2 m m | 22 | time $ print $ vectorMax $ takeDiag $ parMul 2 m m |
20 | time $ print $ vectorMax $ takeDiag $ parMul 4 m m | 23 | time $ print $ vectorMax $ takeDiag $ parMul 4 m m |
21 | time $ print $ vectorMax $ takeDiag $ parMul 8 m m | 24 | time $ print $ vectorMax $ takeDiag $ parMul 8 m m |