Changes between Version 7 and Version 8 of DataParallel/Library

Aug 30, 2011 9:49:49 AM (6 years ago)

Update how DPH is coupled to GHC


  • DataParallel/Library

    v7 v8  
    77DPH is split into the following packages:
    9   * `dph-base`[[br]] Contains shared debugging and tracing functions. Particularly, options for enabling extended sanity checking are hard-codede in the `Config.hs` module.
     9  * `dph-base`[[br]] Contains shared debugging and tracing functions. Particularly, the flags for enabling extended sanity checking are hard-coded in the `Config.hs` module.
    1111  * `dph-prim-seq`[[br]] Flat arrays, and sequential operators on them. Most sequential operators that we used are supplied by `Data.Vector`, but `dph-prim-seq` adds segmented operators that are only useful in the context of nested data parallelism. This package also defines the segment descriptor types, that are also used to implement nested arrays. Flat arrays are also referred to as "unlifted arrays", so this library is also called the "unlifted primitive library".
    3131GHC knows about DPH as follows.
    33   * The flags `-fdph-seq` and `-fdph-par` add `-package dph-seq` and `-package-dph-par`, respectively, so that the user can `import Data.Array.Parallel` and friends.  And so that the right package gets linked in the link step.
     33  * The flags `-fdph-seq` and `-fdph-par` add `-package dph-seq` and `-package dph-par`. These packages contain the types and functions that vectorised code uses. They are produced by compiling `dph-common` against either the `dph-prim-seq` or `dph-prim-par` packages respectively. They also contain the array functions visible to used code via `import Data.Array.Parallel`.
    35   * The flag `-fvectorise` runs a special pass called the '''vectoriser'''.
    36     * The vectoriser generates code that mentions (by Original Name) various functions defined in `dph-prim-seq` or `dph-prim-par` (depending on the compiler flag used).  So if you change where a function is defined in `dph-prim-*`, or the name of the function, you have to make a corresponding change in GHC.
    37     * The vectoriser knows quite a lot about the internal working of the library. For instance, it knows about the array representation.
    38     * Parts of the library are vectorised and since these are low-level parts, they rely on being vectorised in particular ways. This means that a particular version of the library will only work correctly with a particular version of the vectoriser and vice versa.  '''SLPJ: can you be more precise here?  Which packages are vectorised?  What do you meean by "particular ways"?'''
     35  * The vectoriser only generates names exported by dph-common (via either dph-par or dph-seq). It does not use the `dph-prim-interface` API directly.
    41 '''SLPJ: is it correct that GHC only generates Names in dph-prim?  If not, could it be made true?'''