[Haskell-beginners] DPH

Stephen Tetley stephen.tetley at gmail.com
Thu Jun 10 08:05:12 EDT 2010


Hi Luca

if you don't use (data parallel) list comprehensions you shouldn't
need the {-# LANGUAGE ParallelListComp #-} annotation.


Here's and example from the DPH page that uses them:

dotp_double :: [:Double:] -> [:Double:] -> Double
dotp_double xs ys = sumP [:x * y | x <- xs | y <- ys:]

http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell

If you are just using the DPH functionals mapP, zipP etc. {-# LANGUAGE
PArr #-} should be all you need. GHC will need this extension to
handle the [: :] type notation.

I don't know about your second question, from the DPH page it looks
like you need -threaded for multicore, but you can still run DPH code
on single core (if you don't supply -threaded and link to the right
library), see 1.5.6 Parallel execution.


Best wishes

Stephen


More information about the Beginners mailing list