From f14571eb4e167ec0ed5580526a181a013a899e28 Mon Sep 17 00:00:00 2001 From: Ivo Gabe de Wolff Date: Wed, 29 May 2024 15:24:03 +0200 Subject: [PATCH] Fixes in schedule construction and exp pretty printer --- src/Data/Array/Accelerate/Pretty/Exp.hs | 3 ++- src/Data/Array/Accelerate/Trafo/Schedule/Uniform/Future.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Data/Array/Accelerate/Pretty/Exp.hs b/src/Data/Array/Accelerate/Pretty/Exp.hs index 4f2db1667..bbc552f0b 100644 --- a/src/Data/Array/Accelerate/Pretty/Exp.hs +++ b/src/Data/Array/Accelerate/Pretty/Exp.hs @@ -135,7 +135,8 @@ prettyPreOpenExp ctx prettyArrayInstr env exp = -- single = parensIf (needsParens ctx (Operator "?:" Infix N 0)) $ sep [ p', pretty '?', t', pretty ':', e' ] - multi = hang 3 + multi = parensIf (ctxPrecedence ctx > 0) + $ hang 3 $ vsep [ if_ <+> p' , hang shiftwidth (sep [ then_, t' ]) , hang shiftwidth (sep [ else_, e' ]) ] diff --git a/src/Data/Array/Accelerate/Trafo/Schedule/Uniform/Future.hs b/src/Data/Array/Accelerate/Trafo/Schedule/Uniform/Future.hs index 1f664a039..2cb65ac83 100644 --- a/src/Data/Array/Accelerate/Trafo/Schedule/Uniform/Future.hs +++ b/src/Data/Array/Accelerate/Trafo/Schedule/Uniform/Future.hs @@ -707,7 +707,7 @@ loopFuture resolved (FutureBuffer tp ref (Move readLockSignal) (Just (Move write $ Just $ Borrow (Just signalW) resolverR | otherwise -> internalError "input or output impossible" } -loopFuture resolved (FutureBuffer tp ref (Lock readLockSignal readLockResolver) (Just (Lock writeLockSignal writeLockResolver))) = undefined +loopFuture resolved (FutureBuffer tp ref (Lock readLockSignal readLockResolver) (Just (Lock writeLockSignal writeLockResolver))) = -- A borrowed writable buffer -- We must add two signals (and accompanying signal resolvers) to the state -- to synchronize read and write access. Furthermore we need to declare two