From 3a90968fac18bbf931420afff6ef866614ecdd7f Mon Sep 17 00:00:00 2001 From: "benl@ouroborus.net" Date: Tue, 16 Mar 2010 06:05:17 +0000 Subject: [PATCH] Add sliceP mapping to vectoriser builtins --- compiler/vectorise/VectBuiltIn.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/compiler/vectorise/VectBuiltIn.hs b/compiler/vectorise/VectBuiltIn.hs index 11538d5..dc01c7c 100644 --- a/compiler/vectorise/VectBuiltIn.hs +++ b/compiler/vectorise/VectBuiltIn.hs @@ -330,6 +330,16 @@ preludeDataCons (Modules { dph_Prelude_Tuple = dph_Prelude_Tuple }) where mk_tup n mod name = (tupleCon Boxed n, mod, name) + +-- | Mapping of prelude functions to vectorised versions. +-- Functions like filterP currently have a working but naive version in GHC.PArr +-- During vectorisation we replace these by calls to filterPA, which are +-- defined in dph-common Data.Array.Parallel.Lifted.Combinators +-- +-- As renamer only sees the GHC.PArr functions, if you want to add a new function +-- to the vectoriser there has to be a definition for it in GHC.PArr, even though +-- it will never be used at runtime. +-- preludeVars :: Modules -> [(Module, FastString, Module, FastString)] preludeVars (Modules { dph_Combinators = dph_Combinators , dph_PArray = dph_PArray @@ -348,6 +358,7 @@ preludeVars (Modules { dph_Combinators = dph_Combinators , mk gHC_PARR (fsLit "lengthP") dph_Combinators (fsLit "lengthPA") , mk gHC_PARR (fsLit "replicateP") dph_Combinators (fsLit "replicatePA") , mk gHC_PARR (fsLit "!:") dph_Combinators (fsLit "indexPA") + , mk gHC_PARR (fsLit "sliceP") dph_Combinators (fsLit "slicePA") , mk gHC_PARR (fsLit "crossMapP") dph_Combinators (fsLit "crossMapPA") , mk gHC_PARR (fsLit "singletonP") dph_Combinators (fsLit "singletonPA") , mk gHC_PARR (fsLit "concatP") dph_Combinators (fsLit "concatPA") -- 1.7.10.4