Update vectoriser now that Scalar has moved
[ghc-hetmet.git] / compiler / vectorise / Vectorise / Builtins / Initialise.hs
index 5f4735c..64172c6 100644 (file)
@@ -43,14 +43,22 @@ initBuiltins pkg
       -- From dph-common:Data.Array.Parallel.PArray.PData
       --   PData is a type family that maps an element type onto the type
       --   we use to hold an array of those elements.
-      pdataTyCon       <- externalTyCon        dph_PData       (fsLit "PData")
+      pdataTyCon       <- externalTyCon        dph_PArray_PData  (fsLit "PData")
 
       --   PR is a type class that holds the primitive operators we can 
       --   apply to array data. Its functions take arrays in terms of PData types.
-      prClass           <- externalClass        dph_PData      (fsLit "PR")
+      prClass           <- externalClass        dph_PArray_PData  (fsLit "PR")
       let prTyCon     = classTyCon prClass
           [prDataCon] = tyConDataCons prTyCon
 
+
+      -- From dph-common:Data.Array.Parallel.PArray.Scalar
+      --   Scalar is the class of scalar values. 
+      --   The dictionary contains functions to coerce U.Arrays of scalars
+      --   to and from the PData representation.
+      scalarClass      <- externalClass        dph_PArray_Scalar (fsLit "Scalar")
+
+
       -- From dph-common:Data.Array.Parallel.Lifted.PArray
       --   A PArray (Parallel Array) holds the array length and some array elements
       --   represented by the PData type family.
@@ -114,7 +122,6 @@ initBuiltins pkg
                                        | i <- [2..mAX_DPH_COMBINE]]
       let combinePDVars = listArray (2, mAX_DPH_COMBINE) combines
 
-      scalarClass      <- externalClass dph_PArray     (fsLit "Scalar")
       scalar_map       <- externalVar  dph_Scalar      (fsLit "scalar_map")
       scalar_zip2      <- externalVar  dph_Scalar      (fsLit "scalar_zipWith")
       scalar_zips      <- mapM (externalVar dph_Scalar)
@@ -175,12 +182,13 @@ initBuiltins pkg
     -- These are the modules from the DPH base library that contain
     --  the primitive array types and functions that vectorised code uses.
     mods@(Modules 
-                { dph_PArray    = dph_PArray
-                , dph_PData     = dph_PData
-                , dph_Repr      = dph_Repr
-                , dph_Closure   = dph_Closure
-                , dph_Scalar    = dph_Scalar
-                , dph_Unboxed   = dph_Unboxed
+                { dph_PArray            = dph_PArray
+                , dph_PArray_PData      = dph_PArray_PData
+                , dph_PArray_Scalar     = dph_PArray_Scalar
+                , dph_Repr              = dph_Repr
+                , dph_Closure           = dph_Closure
+                , dph_Scalar            = dph_Scalar
+                , dph_Unboxed           = dph_Unboxed
                 })
       = dph_Modules pkg
 
@@ -267,7 +275,7 @@ initBuiltinPAs (Builtins { dphModules = mods }) insts
 -- | Get the names of all builtin instance functions for the PR class.
 initBuiltinPRs :: Builtins -> (InstEnv, InstEnv) -> DsM [(Name, Var)]
 initBuiltinPRs (Builtins { dphModules = mods }) insts
-  = liftM (initBuiltinDicts insts) (externalClass (dph_PData mods) (fsLit "PR"))
+  = liftM (initBuiltinDicts insts) (externalClass (dph_PArray_PData mods) (fsLit "PR"))
 
 
 -- | Get the names of all DPH instance functions for this class.