[commit: dph] : comments only (882f81a)
Ben Lippmeier
benl at ouroborus.net
Thu May 12 15:42:09 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/dph
On branch :
http://hackage.haskell.org/trac/ghc/changeset/882f81ae67f2aa158fed0141e8322362c6638565
>---------------------------------------------------------------
commit 882f81ae67f2aa158fed0141e8322362c6638565
Author: Ben Lippmeier <benl at ouroborus.net>
Date: Thu May 5 12:24:22 2011 +1000
comments only
>---------------------------------------------------------------
dph-common/Data/Array/Parallel/Lifted/Closure.hs | 25 +++++++++++++++++----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/dph-common/Data/Array/Parallel/Lifted/Closure.hs b/dph-common/Data/Array/Parallel/Lifted/Closure.hs
index dfe960c..ed4cedc 100644
--- a/dph-common/Data/Array/Parallel/Lifted/Closure.hs
+++ b/dph-common/Data/Array/Parallel/Lifted/Closure.hs
@@ -15,16 +15,31 @@ import GHC.Exts (Int#)
infixr 0 :->
infixl 0 $:, $:^
--- |The type of closures
+-- | The type of closures.
+-- This bundles up
+-- 1) the vectorised verion of the function that takes an explicit environment
+-- 2) the lifted version, that works on arrays.
+-- the first parameter of this function is the 'lifting context'
+-- that gives the length of the array.
+-- 3) the environment of the closure.
--
-data a :-> b = forall e. PA e => Clo !(e -> a -> b)
- !(Int# -> PData e -> PData a -> PData b)
- e
+-- The vectoriser closure-converts the source program so that all functions
+-- types are expressed in this form.
+--
+data a :-> b
+ = forall. PA e
+ => Clo !(e -> a -> b) -- vectorised version
+ !(Int# -> PData e -> PData a -> PData b) -- lifted version
+ e -- environment
+
lifted :: (PArray e -> PArray a -> PArray b)
-> Int# -> PData e -> PData a -> PData b
{-# INLINE lifted #-}
-lifted f n# es as = case f (PArray n# es) (PArray n# as) of PArray _ bs -> bs
+lifted f n# es as
+ = case f (PArray n# es) (PArray n# as) of
+ PArray _ bs -> bs
+
-- |Closure construction
--
More information about the Cvs-libraries
mailing list