Changes between Version 22 and Version 23 of DataParallel/VectPragma
- Timestamp:
- 08/22/11 20:39:40 (21 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DataParallel/VectPragma
v22 v23 14 14 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. 15 15 16 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 i ff `f` is re-exported; otherwise, it is only available in the module in which the pragma is located. By re-exporting a vectorised imported function, we can vectorise functions of modules that have not been compiled with `-fvectorise`. This is crucial to using the standard `Prelude` in vectorised code.16 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. 17 17 18 18 '''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`. … … 102 102 == Cross-module functionality == 103 103 104 The various `VECTORISE` pragmas can be applied to imported variables and types. (For variables still needs to be implemented.) The vectorisation mappings will only be exported if the variable or type to which a pragma is applied is also exported. In other words, if we have 105 {{{ 106 {-# VECTORISE SCALAR type Int #-} 107 }}} 108 where `Int` is imported from the standard Prelude and we want clients to treat `Int` as a scalar vectorised type, then `Int` needs to be re-exported. The re-export, effectively exports the pragma. 104 The various `VECTORISE` pragmas can be applied to imported identifiers (both variables and types). The resulting vectorisation mappings and the vectorised version of the identifier will will be implicitly exported — much like it is the case for `RULES` defined on imported identifiers.
