Skip to content

Commit

Permalink
add option for no fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvanbalen committed May 14, 2024
1 parent 3ce8345 commit 5b70e87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Data/Array/Accelerate/Trafo/Partitioning/ILP/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ class (ShrinkArg (BackendClusterArg op), Eq (BackendVar op), Ord (BackendVar op)
-- allow the backend to add constraints/bounds for every node
finalize :: [Label] -> Constraint op

-- use finalize = finalizeNoFusion to prevent all fusion in a backend
finalizeNoFusion :: [Label] -> Constraint op
finalizeNoFusion = foldMap $ \l -> manifest l .==. int 0 -- each array is manifest
<> c (InDir l) .==. int (_labelId l) -- each operation reads in its own order
<> c (OutDir l) .==. int (_labelId l) -- each operation writes in its own order


-- -- e.g. for backpermutes. This allows the backend to say that horizontal fusion should not be possible between
-- -- two edges from the same source that have different Ints in this map.
-- -- this default implementation just uses InDir, a backend may choose to change it if other variables are also relevant.
Expand Down

0 comments on commit 5b70e87

Please sign in to comment.