Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Haskell
Wiki community
Recent changes
Random page
HaskellWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
GHC/Data Parallel Haskell/Package NDP
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== A small example === The following module implements the dot product of two vectors with package ndp: <haskell> module DotP_ndp (dotp) where import Data.Array.Parallel.Unlifted dotp :: (Num a, UA a) => UArr a -> UArr a -> a dotp xs ys = sumU (zipWithU (*) xs ys) </haskell> We can also use that in an interactive GHCi session: <blockquote><pre> Prelude> :set -package ndp package flags have changed, ressetting and loading new packages... Loading package ndp-1.0 ... linking ... done. Prelude> :l /home/chak/code/haskell/DotP_ndp [1 of 1] Compiling DotP_ndp ( /home/chak/code/haskell/DotP_ndp.hs, interpreted ) Ok, modules loaded: DotP_ndp. *DotP_ndp> dotp (toU [1..3]) (toU [4..6]) Loading package haskell98 ... linking ... done. 32.0 *DotP_ndp> </pre></blockquote> Most of the functions under are still purely sequential, albeit '''much''' more efficient than <tt>GHC.PArr</tt>. In addition, the (currently only few) functions from [http://darcs.haskell.org/packages/ndp/Data/Array/Parallel/Unlifted/Parallel.hs <tt>Data.Array.Parallel.Unlifted.Parallel</tt>] ''transparently'' use multiple processing elements if GHC was compiled with SMP multiprocessor support.
Summary:
Please note that all contributions to HaskellWiki are considered to be released under simple permissive license (see
HaskellWiki:Copyrights
for details). If you don't want your writing to be edited mercilessly and redistributed at will, then don't submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
DO NOT SUBMIT COPYRIGHTED WORK WITHOUT PERMISSION!
Cancel
Editing help
(opens in new window)
Toggle limited content width