-- 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.
| 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)
-- 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
-- | 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.