Also trace the result size of filter operations
authorBen Lippmeier <benl@ouroborus.net>
Tue, 3 May 2011 06:50:33 +0000 (16:50 +1000)
committerBen Lippmeier <benl@ouroborus.net>
Tue, 3 May 2011 06:50:33 +0000 (16:50 +1000)
dph-base/Data/Array/Parallel/Base/TracePrim.hs
dph-prim-par/Data/Array/Parallel/Unlifted.hs

index bf5611d..162f4ef 100644 (file)
@@ -44,7 +44,7 @@ data TracePrim
         | TraceCombine     { traceSrcLength  :: Int }
         | TraceCombine2    { traceSrcLength  :: Int }
         | TraceMap         { traceSrcLength  :: Int }
-        | TraceFilter      { traceSrcLength  :: Int }
+        | TraceFilter      { traceSrcLength  :: Int, traceDstLength  :: Int }
         | TraceZipWith     { traceSrc1Length :: Int, traceSrc2Length :: Int }
         | TraceFold        { traceSrcLength  :: Int }
         | TraceFold1       { traceSrcLength  :: Int }
index 20f8fe1..6955d28 100644 (file)
@@ -140,9 +140,9 @@ map f arr
         $! mapUP f arr
 
 
-filter f arr
-        =  tracePrim (TraceFilter (Seq.length arr))
-        $! filterUP f arr
+filter f src
+ = let  dst     = filterUP f src
+   in   tracePrim (TraceFilter (Seq.length src) (Seq.length dst)) dst
 
 
 zipWith f arr1 arr2