Changes between Version 22 and Version 23 of DataParallel/VectPragma


Ignore:
Timestamp:
Aug 23, 2011 3:39:40 AM (3 years ago)
Author:
chak
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DataParallel/VectPragma

    v22 v23  
    1414then 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. 
    1515 
    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 iff `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. 
     16This 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. 
    1717 
    1818'''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`. 
     
    102102== Cross-module functionality == 
    103103 
    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. 
     104The 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.