Changes between Version 10 and Version 11 of DataParallel/Vectorisation
- Timestamp:
- 05/28/07 00:31:57 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DataParallel/Vectorisation
v10 v11 78 78 }}} 79 79 80 Hmm, thinking about this, a data type will get us into trouble with unboxed types. Maybe 80 Hmm, 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 82 A data type to combine the scalar and lifted version of a function: 81 83 {{{ 82 type a ->> b = (a -> b) :*: (a^ -> b^) 83 vect :: (a -> b) -> (a ->> b)84 vect f = f :*: mapP f 84 data VFun f = VFun { vfunS :: !f 85 , vfunP :: !(PArr f) 86 } 85 87 }}} 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. 88 On top of this we can define a vectorised function space constructor: 89 {{{ 90 newtype a :-> b = Fun (VFun (a -> b)) 91 funS (Fun (VFun f _)) = f 92 funP (Fun (VFun _ f)) = f 93 }}} 94 So, 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. 87 95 ---- 88 96
