... | ... | @@ -35,9 +35,14 @@ Secondly, if a variable `f` is accompanied by a pragma of the form |
|
|
then the vectoriser defines `f_v = e` and refrains from rebinding `f`. This implies that for `f :: t`, `e`'s type is the `t` vectorised (in particular), `e`'s type uses the array closure type `(:->)` instead of the vanilla function space `(->)`. The vectoriser checks that `e` has the appropriate type.
|
|
|
|
|
|
|
|
|
|
|
|
This pragma can also be used for imported functions `f`. In this case, `f_v` and a suitable vectorisation mapping of `f` to `f_v` is exported implicitly — just like `RULES` applied to imported identifiers. By vectorising imported functions, we can vectorise functions of modules that have not been compiled with `-fvectorise`. This is crucial to using the standard `Prelude` in vectorised code.
|
|
|
|
|
|
*Parallelism:*`f` is marked as parallel if it is **not** imported.
|
|
|
|
|
|
|
|
|
*Parallelism:* `f` is marked as parallel if it is **not** imported.
|
|
|
|
|
|
|
|
|
|
|
|
**IMPLEMENTATION RESTRICTION:** Currently the right-hand side of the equation —i.e., `e`— may only be a simple identifier **and** it must be at the correct type instance. More precisely, the Core type of the right-hand side must be identical to the vectorised version of `t`.
|
|
|
|
... | ... | @@ -54,9 +59,14 @@ If a variable `f` is accompanied by a pragma |
|
|
then it is ignored by the vectoriser — i.e., no function `f_v` is generated and `f` is left untouched.
|
|
|
|
|
|
|
|
|
|
|
|
This pragma can only be used for bindings in the current module (exactly like an `INLINE` pragma). The pragma must be used on all bindings forming a recursive group if it is used on any of the bindings in a group.
|
|
|
|
|
|
*Parallelism:*`f` will not be marked as parallel.
|
|
|
|
|
|
|
|
|
*Parallelism:* `f` will not be marked as parallel.
|
|
|
|
|
|
|
|
|
|
|
|
**Caveat:** If `f`'s definition contains bindings that are being floated to the toplevel, those bindings may still be vectorised. (**TODO** We might want to ensure that we never float anything out of (at least, those) bindings before the vectoriser is invoked.)
|
|
|
|
... | ... | @@ -83,9 +93,13 @@ indicates that the type `T` should be automatically vectorised even if it is imp |
|
|
The type constructor `T` must be in scope, but it may be imported. `PData` and `PRepr` instances are automatically generated by the vectoriser.
|
|
|
|
|
|
|
|
|
|
|
|
Examples are the vectorisation of types, such as `Maybe` and `[]`, defined in the `Prelude`.
|
|
|
|
|
|
*Parallelism:*`T` is being marked as parallel by the vectoriser if `T`'s definition includes any type constructor that is parallel.
|
|
|
|
|
|
|
|
|
*Parallelism:* `T` is being marked as parallel by the vectoriser if `T`'s definition includes any type constructor that is parallel.
|
|
|
|
|
|
|
|
|
### With right-hand side
|
|
|
|
... | ... | |