Changes between Version 11 and Version 12 of DataParallel/Vectorisation


Ignore:
Timestamp:
May 28, 2007 8:15:00 AM (8 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/Vectorisation

    v11 v12  
    8282A data type to combine the scalar and lifted version of  a function: 
    8383{{{ 
    84 data VFun f = VFun { vfunS :: !f 
    85                    , vfunP :: !(PArr f) 
    86                    } 
     84data fS :|| fP = !fS :|| !fP 
     85vfunS (fS :|| _ ) = fS 
     86vfunP (_  :|| fP) = fP 
    8787}}} 
    88 On top of this we can define a vectorised function space constructor: 
     88On top of this we define a vectorised function space constructor: 
    8989{{{ 
    9090newtype a :-> b = Fun (VFun (a -> b)) 
    91 funS (Fun (VFun f _)) = f 
    92 funP (Fun (VFun _ f)) = f 
     91funS (Fun (fS :|| _ )) = fS 
     92funP (Fun (_  :|| fP)) = fP 
    9393}}} 
    9494So, 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.