Skip to content

Commit

Permalink
don't require the new MIP version for now bc the git repository is an…
Browse files Browse the repository at this point in the history
…noying
  • Loading branch information
dpvanbalen committed Apr 9, 2024
1 parent ab85161 commit d4d36c6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ import qualified Debug.Trace

instance (MakesILP op, MIP.IsSolver s IO) => ILPSolver s op where
solve :: s -> ILP op -> IO (Maybe (Solution op))
solve s (ILP dir obj constr bnds n) = makeSolution names <$> MIP.solve s options problem
solve s (ILP dir obj constr bnds n) = makeSolution names . addZeroes <$> MIP.solve s options problem
where
options = MIP.SolveOptions{ MIP.solveTimeLimit = Just 60
, MIP.solveLogger = const (pure ()) --putStrLn . ("AccILPSolver: " ++)
, MIP.solveErrorLogger = putStrLn . ("AccILPSolverError: " ++)
, MIP.solveCondensedSolution = False }
-- }
} --, MIP.solveCondensedSolution = False }


stateProblem = flip -- we need this flip to make `bounds` happen before `vartypes` in the monad, so that we also give the variables that only occur in bounds a type.
<$> (Problem (Just "AccelerateILP") <$> (mkFun dir <$> expr n obj) <*> cons n constr <*> pure [] <*> pure [])
Expand All @@ -60,6 +60,12 @@ instance (MakesILP op, MIP.IsSolver s IO) => ILPSolver s op where

vartypes = allIntegers -- assuming that all variables have bounds


addZeroes :: MIP.Problem Scientific -> MIP.Solution Scientific -> MIP.Solution Scientific
addZeroes problem (Solution stat obj solmap) =

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.2 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.0 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-8.10 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.2 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.0 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.4 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-8.10 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.4 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.2 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.2 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | ubuntu-latest-x64

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.0 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.0 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-8.10 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.4 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | windows-latest-x64

Not in scope: data constructor `Solution'

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.2 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-8.10 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-8.10 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.0 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.4 debug

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.4 release

Not in scope: data constructor ‘Solution’

Check failure on line 65 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | macOS-latest-x64

Not in scope: data constructor ‘Solution’
-- Map.union is left-biased: only values not present in the solution are added.
Solution stat obj $ Map.union solmap (Map.fromSet (const 0) (vars problem))

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.2 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.2 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.0 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.0 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-8.10 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-8.10 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.2 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.2 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.0 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.0 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.4 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.4 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-8.10 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-8.10 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.4 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | ubuntu-latest-x64 ghc-9.4 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.2 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.2 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.2 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.2 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | ubuntu-latest-x64

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | ubuntu-latest-x64

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.0 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.0 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.0 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.0 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-8.10 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-8.10 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.4 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | windows-latest-x64 ghc-9.4 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | windows-latest-x64

Not in scope: `Map.union'

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.2 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.2 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-8.10 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-8.10 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-8.10 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-8.10 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.0 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.0 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.4 debug

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.4 debug

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.4 release

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / cabal | macOS-latest-x64 ghc-9.4 release

Not in scope: ‘Map.fromSet’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | macOS-latest-x64

Not in scope: ‘Map.union’

Check failure on line 67 in src/Data/Array/Accelerate/Trafo/Partitioning/ILP/MIP.hs

View workflow job for this annotation

GitHub Actions / stack | macOS-latest-x64

Not in scope: ‘Map.fromSet’

-- MIP has a Num instance for expressions, but it's scary (because
-- you can't guarantee linearity with arbitrary multiplications).
-- We use that instance here, knowing that our own Expression can only be linear.
Expand Down

0 comments on commit d4d36c6

Please sign in to comment.