Changes between Version 10 and Version 11 of DataParallel/Vectorisation


Ignore:
Timestamp:
May 28, 2007 7:31:57 AM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Vectorisation

    v10 v11  
    7878}}}
    7979
    80 Hmm, thinking about this, a data type will get us into trouble with unboxed types.  Maybe
     80Hmm, thinking about this, a data type will get us into trouble with unboxed types, but we also can't use a type synonym, as we can have partial applications of function arrows.  So, we have to split this up.
     81
     82A data type to combine the scalar and lifted version of  a function:
    8183{{{
    82 type a ->> b = (a -> b) :*: (a^ -> b^)
    83 vect :: (a -> b) -> (a ->> b)
    84 vect f = f :*: mapP f
     84data VFun f = VFun { vfunS :: !f
     85                   , vfunP :: !(PArr f)
     86                   }
    8587}}}
    86 But that doesn't make any sense due to the `a^` and `b^`.  Seems like we have to hardcode this representation into the type translation scheme.
     88On top of this we can define a vectorised function space constructor:
     89{{{
     90newtype a :-> b = Fun (VFun (a -> b))
     91funS (Fun (VFun f _)) = f
     92funP (Fun (VFun _ f)) = f
     93}}}
     94So, we have `(->_v) = (:->)`.  Note that the type arguments to `(:->)` will be vectorised types (not vanilla types).  Consequently, instances of `PA` and `PArr` need to be defined for vectorised types.
    8795----
    8896