Skip to content

Commit

Permalink
Use splitAt3.
Browse files Browse the repository at this point in the history
  • Loading branch information
nhey committed Aug 9, 2023
1 parent 396a352 commit 6672e94
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Futhark/IR/SOACS/SOAC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import Futhark.IR.TypeCheck qualified as TC
import Futhark.Optimise.Simplify.Rep
import Futhark.Transform.Rename
import Futhark.Transform.Substitute
import Futhark.Util (chunks, maybeNth)
import Futhark.Util (chunks, maybeNth, splitAt3)
import Futhark.Util.Pretty (Doc, align, comma, commasep, docText, parens, ppTuple', pretty, (<+>), (</>))
import Futhark.Util.Pretty qualified as PP
import Prelude hiding (id, (.))
Expand Down Expand Up @@ -600,19 +600,18 @@ instance ASTRep rep => IsOp (SOAC rep) where
let deps_nes = map (depsOf mempty) nes
in lambdaDependencies mempty lam (zipWith (<>) deps_nes deps_in)

deps_map = print "deps_map" $
lambdaDependencies mempty map_lam (map oneName arrs)
(deps_scans_in', deps_reds_in', deps_map) = print "deps_map" $
splitAt3 (scanResults scans) (redResults reds) $
lambdaDependencies mempty map_lam (map oneName arrs)

(deps_scans_in', deps_map') = splitAt (scanResults scans) deps_map
deps_scans_in = chunks (scanSizes scans) deps_scans_in'
deps_scans = print "deps_scans" $
concatMap depsOfScan (zip scans deps_scans_in)

(deps_reds_in', deps_map'') = splitAt (redResults reds) deps_map'
deps_reds_in = chunks (redSizes reds) deps_reds_in'
deps_reds = print "deps_reds" $
concatMap depsOfRed (zip reds deps_reds_in)
in print "deps_screma" $ deps_scans <> deps_reds <> deps_map''
in print "deps_screma" $ deps_scans <> deps_reds <> deps_map
where
print msg x = Debug.Trace.trace (msg ++ " " ++ show x ++ "\n") x

Check warning on line 616 in src/Futhark/IR/SOACS/SOAC.hs

View workflow job for this annotation

GitHub Actions / build-linux-cabal

This binding for ‘print’ shadows the existing binding
scanSizes = map (length . scanNeutral)
Expand Down

0 comments on commit 6672e94

Please sign in to comment.