Skip to content

Commit

Permalink
Fix compile errors on old GHCs and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed May 25, 2020
1 parent 9e2dadb commit eb10416
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Data/Array/Accelerate/Analysis/Match.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ type MatchAcc acc = forall aenv s t. acc aenv s -> acc aenv t -> Maybe (s :~: t)
matchPreOpenAcc
:: forall acc aenv s t. HasArraysRepr acc
=> MatchAcc acc
-> EncodeAcc acc
-> PreOpenAcc acc aenv s
-> PreOpenAcc acc aenv t
-> Maybe (s :~: t)
matchPreOpenAcc matchAcc encodeAcc = match
matchPreOpenAcc matchAcc = match
where
matchFun :: OpenFun env' aenv' u -> OpenFun env' aenv' v -> Maybe (u :~: v)
matchFun = matchOpenFun
Expand Down Expand Up @@ -915,7 +914,7 @@ matchNonNumType _ _ = Nothing
-- commutativity.
--
commutes
:: forall acc env aenv a r.
:: forall env aenv a r.
PrimFun (a -> r)
-> OpenExp env aenv a
-> Maybe (OpenExp env aenv a)
Expand Down
6 changes: 3 additions & 3 deletions src/Data/Array/Accelerate/Trafo/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ encodeOpenAcc :: EncodeAcc OpenAcc
encodeOpenAcc options (OpenAcc pacc) = encodePreOpenAcc options encodeAcc pacc

matchOpenAcc :: MatchAcc OpenAcc
matchOpenAcc (OpenAcc pacc1) (OpenAcc pacc2) = matchPreOpenAcc matchAcc encodeAcc pacc1 pacc2
matchOpenAcc (OpenAcc pacc1) (OpenAcc pacc2) = matchPreOpenAcc matchAcc pacc1 pacc2

avarIn :: forall acc aenv a. Kit acc => ArrayVar aenv a -> acc aenv a
avarIn v@(Var ArrayR{} _) = inject $ Avar v
Expand Down Expand Up @@ -184,7 +184,7 @@ instance Match (OpenFun env aenv) where

instance Kit acc => Match (PreOpenAcc acc aenv) where
{-# INLINEABLE match #-}
match = matchPreOpenAcc matchAcc encodeAcc
match = matchPreOpenAcc matchAcc

instance {-# INCOHERENT #-} Kit acc => Match (acc aenv) where
{-# INLINEABLE match #-}
Expand Down Expand Up @@ -278,7 +278,7 @@ encodeDelayedOpenAcc options acc =
{-# INLINEABLE matchDelayedOpenAcc #-}
matchDelayedOpenAcc :: MatchAcc DelayedOpenAcc
matchDelayedOpenAcc (Manifest pacc1) (Manifest pacc2)
= matchPreOpenAcc matchDelayedOpenAcc encodeDelayedOpenAcc pacc1 pacc2
= matchPreOpenAcc matchDelayedOpenAcc pacc1 pacc2

matchDelayedOpenAcc (Delayed _ sh1 ix1 lx1) (Delayed _ sh2 ix2 lx2)
| Just Refl <- matchOpenExp sh1 sh2
Expand Down
1 change: 1 addition & 0 deletions src/Data/Array/Accelerate/Trafo/Substitution.hs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ reindexAvar v = ReindexAvar f where
f :: forall sh e. ArrayVar aenv (Array sh e) -> f (ArrayVar aenv' (Array sh e))
f var = g <$> v var

g :: fa acc aenv' (Array sh e) -> ArrayVar aenv' (Array sh e)
g fa = case accOut fa of
Avar var' -> var'
_ -> $internalError "reindexAvar" "An Avar which was used in an Exp was mapped to an array term other than Avar. This mapping is invalid as an Exp can only contain array variables."
Expand Down

0 comments on commit eb10416

Please sign in to comment.