Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git@github.com:nushio3/Paraiso

  • Loading branch information...
commit 52635e7ce9408b606a4212863f0eaafbda51e9c7 2 parents 4068a4a + f1b853e
@nushio3 authored
Showing with 94 additions and 83 deletions.
  1. +4 −3 Language/Paraiso/Annotation.hs
  2. +2 −1  Language/Paraiso/Annotation/Allocation.hs
  3. +2 −1  Language/Paraiso/Annotation/Balloon.hs
  4. +1 −1  Language/Paraiso/Annotation/Boundary.hs
  5. +1 −1  Language/Paraiso/Annotation/Comment.hs
  6. +1 −1  Language/Paraiso/Annotation/Dependency.hs
  7. +1 −1  Language/Paraiso/Annotation/Execution.hs
  8. +1 −1  Language/Paraiso/Annotation/SyncThreads.hs
  9. +3 −1 Language/Paraiso/Generator.hs
  10. +2 −1  Language/Paraiso/Generator/Claris.hs
  11. +4 −2 Language/Paraiso/Generator/ClarisTrans.hs
  12. +2 −2 Language/Paraiso/Generator/Cpp-old.hs
  13. +1 −1  Language/Paraiso/Generator/Cpp.hs
  14. +1 −1  Language/Paraiso/Generator/Native.hs
  15. +2 −2 Language/Paraiso/Generator/OMTrans.hs
  16. +3 −1 Language/Paraiso/Generator/Plan.hs
  17. +12 −10 Language/Paraiso/Generator/PlanTrans.hs
  18. +1 −1  Language/Paraiso/Interval.hs
  19. +1 −1  Language/Paraiso/OM.hs
  20. +1 −1  Language/Paraiso/OM/Arithmetic.hs
  21. +1 −1  Language/Paraiso/OM/Builder.hs
  22. +1 −1  Language/Paraiso/OM/Builder/Boolean.hs
  23. +2 −1  Language/Paraiso/OM/Builder/Internal.hs
  24. +2 −1  Language/Paraiso/OM/PrettyPrint.hs
  25. +1 −1  Language/Paraiso/OM/Realm.hs
  26. +2 −2 Language/Paraiso/Optimization.hs
  27. +3 −2 Language/Paraiso/Optimization/BoundaryAnalysis.hs
  28. +3 −1 Language/Paraiso/Optimization/DeadCodeElimination.hs
  29. +1 −2  Language/Paraiso/Optimization/DecideAllocation.hs
  30. +1 −2  Language/Paraiso/Optimization/DependencyAnalysis.hs
  31. +2 −3 Language/Paraiso/Optimization/Graph.hs
  32. +1 −1  Language/Paraiso/Optimization/Identity.hs
  33. +1 −1  Language/Paraiso/Orthotope.hs
  34. +1 −1  Language/Paraiso/PiSystem.hs
  35. +6 −14 Language/Paraiso/Prelude.hs
  36. +13 −12 Language/Paraiso/Tuning/Genetic.hs
  37. +2 −3 Paraiso.cabal
  38. +5 −0 include/numeric-prelude-restricted.hs
View
7 Language/Paraiso/Annotation.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE CPP #-}
{-# OPTIONS -Wall #-}
-- | 'Annotation' is a collection of 'Typeable's
-- with which you can annotate each OM node.
@@ -8,10 +8,11 @@ module Language.Paraiso.Annotation
Annotation, add, empty, map, set, weakSet, toList, toMaybe
) where
+import Control.Monad
import Data.Dynamic
import Data.Maybe
-import Language.Paraiso.Prelude hiding (map, toList)
-import qualified Language.Paraiso.Prelude as P (map)
+import Prelude hiding (map)
+import qualified Prelude as P (map)
type Annotation = [Dynamic]
View
3  Language/Paraiso/Annotation/Allocation.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | An 'Annotation' that selects whether the data should be
-- stored globally on memory or to be calculated.
@@ -9,6 +9,7 @@ module Language.Paraiso.Annotation.Allocation (
import Data.Dynamic
import Language.Paraiso.Prelude
+import Prelude (Eq, Show)
data Allocation
= Existing -- ^ This entity is already allocated as a static variable.
View
3  Language/Paraiso/Annotation/Balloon.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | An 'Annotation' that sets the execution priority of the
-- statements. Statements with 'Ballon's will be allocated
@@ -11,6 +11,7 @@ module Language.Paraiso.Annotation.Balloon (
import Data.Dynamic
import Language.Paraiso.Prelude
+import Prelude (Eq, Ord)
data (Ord a, Typeable a) => Balloon a
= Balloon a
View
2  Language/Paraiso/Annotation/Boundary.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, FlexibleContexts, NoImplicitPrelude, StandaloneDeriving,
+{-# LANGUAGE CPP, DeriveDataTypeable, FlexibleContexts, StandaloneDeriving,
UndecidableInstances #-}
{-# OPTIONS -Wall #-}
View
2  Language/Paraiso/Annotation/Comment.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | An effectless 'Annotation' with a comment
View
2  Language/Paraiso/Annotation/Dependency.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | An 'Annotation' that describes the dependency of the nodes
-- and labels certain group of Manifest nodes
View
2  Language/Paraiso/Annotation/Execution.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | An effectless 'Annotation' with a comment
View
2  Language/Paraiso/Annotation/SyncThreads.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | An 'Annotation' that lets you call __syncthreads() before
-- or after a statement.
View
4 Language/Paraiso/Generator.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, NoImplicitPrelude, OverloadedStrings #-}
+{-# LANGUAGE CPP, FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, OverloadedStrings #-}
{-# OPTIONS -Wall #-}
-- | a general code generator definition.
module Language.Paraiso.Generator
@@ -6,6 +6,7 @@ module Language.Paraiso.Generator
generate, generateIO
) where
+import Control.Monad
import qualified Language.Paraiso.Annotation as Anot
import qualified Language.Paraiso.Generator.Claris as C
import qualified Language.Paraiso.Generator.ClarisTrans as C
@@ -20,6 +21,7 @@ import qualified Data.Text as T
import qualified Data.Text.IO as T
import System.Directory (createDirectoryIfMissing)
import System.FilePath ((</>))
+import Prelude hiding ((++))
-- | Perform the code generation and returns the list of written
View
3  Language/Paraiso/Generator/Claris.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, MultiParamTypeClasses,
+{-# LANGUAGE CPP, DeriveDataTypeable, MultiParamTypeClasses,
NoImplicitPrelude, OverloadedStrings, RankNTypes #-}
{-# OPTIONS -Wall #-}
-- | [CLARIS] C++-Like Abstract Representation of Intermediate Syntax.
@@ -36,6 +36,7 @@ module Language.Paraiso.Generator.Claris (
import qualified Data.Dynamic as Dyn
import Language.Paraiso.Name
import Language.Paraiso.Prelude
+import NumericPrelude
-- | A Claris program.
data Program
View
6 Language/Paraiso/Generator/ClarisTrans.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE FlexibleContexts, ImpredicativeTypes,
-MultiParamTypeClasses, NoImplicitPrelude, OverloadedStrings,
+{-# LANGUAGE CPP, FlexibleContexts, ImpredicativeTypes, NoImplicitPrelude,
+MultiParamTypeClasses, OverloadedStrings,
RankNTypes #-}
{-# OPTIONS -Wall #-}
@@ -9,6 +9,7 @@ module Language.Paraiso.Generator.ClarisTrans (
headerFile, sourceFile, Context
) where
+import Control.Monad
import qualified Data.Dynamic as Dyn
import qualified Data.List as L
import qualified Data.ListLike as LL
@@ -16,6 +17,7 @@ import qualified Data.ListLike.String as LL
import Language.Paraiso.Generator.Claris
import Language.Paraiso.Name
import Language.Paraiso.Prelude
+import NumericPrelude hiding ((++))
class Translatable a where
translate :: Context -> a -> Text
View
4 Language/Paraiso/Generator/Cpp-old.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE FlexibleContexts, FlexibleInstances,
- MultiParamTypeClasses, NoImplicitPrelude, PackageImports,
+{-# LANGUAGE CPP, FlexibleContexts, FlexibleInstances,
+ MultiParamTypeClasses, PackageImports,
TypeFamilies #-}
{-# OPTIONS -Wall #-}
-- | a code generator definition for single-core c++ program.
View
2  Language/Paraiso/Generator/Cpp.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, OverloadedStrings #-}
{-# OPTIONS -Wall #-}
-- | a code generator definition for single-core c++ program.
module Language.Paraiso.Generator.Cpp
View
2  Language/Paraiso/Generator/Native.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE KindSignatures #-}
+{-# LANGUAGE CPP, KindSignatures #-}
{-# OPTIONS -Wall #-}
-- | informations for generating native codes.
View
4 Language/Paraiso/Generator/OMTrans.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.Generator.OMTrans (
@@ -26,7 +26,7 @@ import qualified Language.Paraiso.OM.Realm as Realm
import qualified Language.Paraiso.Optimization as Opt
import qualified Language.Paraiso.PiSystem as Pi
import Language.Paraiso.Prelude
-
+import NumericPrelude hiding ((++))
data Triplet v g
View
4 Language/Paraiso/Generator/Plan.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE FunctionalDependencies, MultiParamTypeClasses, NoImplicitPrelude, OverloadedStrings #-}
+{-# LANGUAGE CPP, FunctionalDependencies, MultiParamTypeClasses, OverloadedStrings #-}
+{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS -Wall #-}
-- | Taking the optimized OM as the input,
@@ -24,6 +25,7 @@ import qualified Language.Paraiso.OM.DynValue as DVal
import qualified Language.Paraiso.OM.Graph as OM
import qualified Language.Paraiso.OM.Realm as Realm
import Language.Paraiso.Prelude
+import NumericPrelude hiding ((++))
-- | A data structure that contains all informations
View
22 Language/Paraiso/Generator/PlanTrans.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE DeriveDataTypeable, ExistentialQuantification, NoImplicitPrelude,
-OverloadedStrings, TupleSections #-}
+{-# LANGUAGE CPP, DeriveDataTypeable, ExistentialQuantification,
+NoImplicitPrelude, OverloadedStrings, TupleSections #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.Generator.PlanTrans (
@@ -14,6 +14,7 @@ import qualified Data.Graph.Inductive as FGL
import Data.List (sortBy)
import qualified Data.ListLike.String as LL
import Data.ListLike.Text ()
+import qualified Data.Foldable as F
import Data.Maybe
import qualified Data.Set as Set
import Data.Tensor.TypeLevel
@@ -30,7 +31,8 @@ import qualified Language.Paraiso.OM.Graph as OM
import qualified Language.Paraiso.OM.Realm as Realm
import qualified Language.Paraiso.Optimization.Graph as Opt
import Language.Paraiso.Name
-import Language.Paraiso.Prelude
+import Language.Paraiso.Prelude hiding (Boolean(..))
+import NumericPrelude hiding ((++))
type AnAn = Anot.Annotation
@@ -106,10 +108,10 @@ memberFuncForSize env@(Env setup plan) =
makeMami True "upperMargin" uM ++
makeMami False "memorySize" memorySize
where
- size = toList $ Native.localSize setup
- memorySize = toList $ Native.localSize setup + Plan.lowerMargin plan + Plan.upperMargin plan
- lM = toList $ Plan.lowerMargin plan
- uM = toList $ Plan.upperMargin plan
+ size = F.toList $ Native.localSize setup
+ memorySize = F.toList $ Native.localSize setup + Plan.lowerMargin plan + Plan.upperMargin plan
+ lM = F.toList $ Plan.lowerMargin plan
+ uM = F.toList $ Plan.upperMargin plan
makeMami alone label xs =
(if not alone then (finale label xs :) else id) $
@@ -336,8 +338,8 @@ loopMaker env@(Env setup plan) realm subker = case realm of
loopStrideCuda = mkVarExpr "blockDim.x * gridDim.x"
loopCounter = C.Var tSizet (mkName "i")
- memorySize = toList $ Native.localSize setup + Plan.lowerMargin plan + Plan.upperMargin plan
- boundarySize = toList $ Native.localSize setup + Plan.lowerMargin plan + Plan.upperMargin plan
+ memorySize = F.toList $ Native.localSize setup + Plan.lowerMargin plan + Plan.upperMargin plan
+ boundarySize = F.toList $ Native.localSize setup + Plan.lowerMargin plan + Plan.upperMargin plan
- Plan.lowerBoundary subker - Plan.upperBoundary subker
codecDiv =
@@ -521,7 +523,7 @@ cursorToText :: Opt.Ready v g => Env v g -> v g -> T.Text
cursorToText _ cursor = cursorT
where
cursorT :: T.Text
- cursorT = foldl1 connector $ compose (\i -> T.map sanitize $ showT (cursor ! i))
+ cursorT = F.foldl1 connector $ compose (\i -> T.map sanitize $ showT (cursor ! i))
connector a b = a ++ "_" ++ b
sanitize c
| isDigit c = c
View
2  Language/Paraiso/Interval.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, IncoherentInstances #-}
+{-# LANGUAGE CPP, DeriveDataTypeable, IncoherentInstances #-}
{- | an 'Interval' is a pair of 'lower' and 'upper',
representing some interval in ordered system.
The lower bound is inclusive and the upper bound is exclusive:
View
2  Language/Paraiso/OM.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.OM
(
View
2  Language/Paraiso/OM/Arithmetic.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE CPP, NoImplicitPrelude #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.OM.Arithmetic
(
View
2  Language/Paraiso/OM/Builder.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, NoImplicitPrelude, RankNTypes, TypeSynonymInstances #-}
+{-# LANGUAGE CPP, FlexibleInstances, RankNTypes, TypeSynonymInstances #-}
{-# OPTIONS -Wall #-}
-- | A monadic library to build dataflow graphs for OM.
View
2  Language/Paraiso/OM/Builder/Boolean.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, NoImplicitPrelude, RankNTypes,
+{-# LANGUAGE CPP, FlexibleInstances, RankNTypes,
TypeSynonymInstances #-}
{-# OPTIONS -Wall #-}
-- | An extension module of building blocks. Contains booleans, comparison operations, branchings.
View
3  Language/Paraiso/OM/Builder/Internal.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, KindSignatures, NoImplicitPrelude,
+{-# LANGUAGE CPP, FlexibleInstances, KindSignatures, NoImplicitPrelude,
PackageImports, RankNTypes, TypeSynonymInstances #-}
{-# OPTIONS -Wall #-}
@@ -45,6 +45,7 @@ import Language.Paraiso.OM.Reduce as Reduce
import Language.Paraiso.OM.Value as Val
import Language.Paraiso.Prelude
import qualified Prelude (Num(..), Fractional(..))
+import NumericPrelude hiding ((++))
-- | Create a 'Kernel' from a 'Builder' monad.
buildKernel ::
View
3  Language/Paraiso/OM/PrettyPrint.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
+{-# LANGUAGE CPP, OverloadedStrings #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.OM.PrettyPrint (
@@ -23,6 +23,7 @@ import Language.Paraiso.OM
import Language.Paraiso.OM.Graph
import Language.Paraiso.Optimization.Graph as Opt
import Language.Paraiso.Prelude
+import Prelude hiding ((++))
-- | pretty print the OM, neglecting any annotations.
prettyPrint :: Opt.Ready v g => OM v g a -> T.Text
View
2  Language/Paraiso/OM/Realm.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, UndecidableInstances #-}
+{-# LANGUAGE CPP, FlexibleInstances, UndecidableInstances #-}
{-# OPTIONS -Wall #-}
-- | The 'Realm' represents how the data reside in Orthotope Machines.
View
4 Language/Paraiso/Optimization.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE DeriveDataTypeable, KindSignatures,
-MultiParamTypeClasses, NoImplicitPrelude, RankNTypes
+{-# LANGUAGE CPP, DeriveDataTypeable, KindSignatures,
+MultiParamTypeClasses, RankNTypes
#-}
{-# OPTIONS -Wall #-}
View
5 Language/Paraiso/Optimization/BoundaryAnalysis.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable, NoImplicitPrelude #-}
{-# OPTIONS -Wall #-}
-- | The volume of mesh that contains the correct results shrinks as
@@ -15,6 +15,7 @@ module Language.Paraiso.Optimization.BoundaryAnalysis (
import qualified Algebra.Additive as Additive
import qualified Data.Graph.Inductive as FGL
+import Data.Foldable (toList)
import Data.Maybe
import Data.Tensor.TypeLevel
import Data.Typeable
@@ -27,7 +28,7 @@ import Language.Paraiso.OM.Graph
import Language.Paraiso.OM.Realm as Realm
import Language.Paraiso.PiSystem
import Language.Paraiso.Prelude
-
+import NumericPrelude hiding ((++))
boundaryAnalysis :: (Vector v, Additive.C g, Ord g, Typeable g)
=> Graph v g Anot.Annotation -> Graph v g Anot.Annotation
View
4 Language/Paraiso/Optimization/DeadCodeElimination.hs
@@ -1,9 +1,10 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude, TupleSections #-}
+{-# LANGUAGE CPP, DeriveDataTypeable, TupleSections #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.Optimization.DeadCodeElimination (
deadCodeElimination
) where
+import Control.Applicative
import qualified Data.Graph.Inductive as FGL
import Data.Maybe
import qualified Data.Vector as V
@@ -12,6 +13,7 @@ import qualified Language.Paraiso.Annotation.Execution as Anot
import Language.Paraiso.Prelude
import Language.Paraiso.OM.Graph
import Language.Paraiso.Optimization.Graph
+import Prelude hiding ((++))
-- | an optimization that changes nothing.
deadCodeElimination :: Optimization
View
3  Language/Paraiso/Optimization/DecideAllocation.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | The choice of making each Orthotope Machine node Manifest or not
@@ -17,7 +17,6 @@ import qualified Data.Graph.Inductive as FGL
import Data.Maybe
import qualified Language.Paraiso.Annotation as Anot
import Language.Paraiso.Annotation.Allocation as Alloc
-import Language.Paraiso.Prelude
import Language.Paraiso.OM.Graph
import Language.Paraiso.OM.DynValue as DVal
import Language.Paraiso.OM.Realm as Realm
View
3  Language/Paraiso/Optimization/DependencyAnalysis.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
-- | This module performs dependency analysis for generating subroutines.
@@ -31,7 +31,6 @@ import qualified Language.Paraiso.OM.DynValue as DVal
import Language.Paraiso.OM.Graph
import qualified Language.Paraiso.OM.Realm as Realm
import qualified Language.Paraiso.Optimization.Graph as Opt
-import Language.Paraiso.Prelude
-- | Give unique numbering to each groups in the entire OM
-- in preparation for code generation
View
5 Language/Paraiso/Optimization/Graph.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE FlexibleContexts, FlexibleInstances, KindSignatures, MultiParamTypeClasses,
-NoImplicitPrelude, RankNTypes, UndecidableInstances #-}
+{-# LANGUAGE CPP, FlexibleContexts, FlexibleInstances, KindSignatures, MultiParamTypeClasses,
+ RankNTypes, UndecidableInstances #-}
{-# OPTIONS -Wall #-}
-- | Basic definitions for optimization
@@ -19,7 +19,6 @@ import Language.Paraiso.Annotation (Annotation)
import Language.Paraiso.OM.Graph
import Language.Paraiso.OM
import Language.Paraiso.Prelude
-import Prelude (Num)
-- | (Ready v g) indicates that the pair (v, g) has all the instances
View
2  Language/Paraiso/Optimization/Identity.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable, NoImplicitPrelude #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.Optimization.Identity (
identity
View
2  Language/Paraiso/Orthotope.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE CPP, TypeOperators #-}
{- | In geometry, an 'Orthotope' (also called a hyperrectangle or a box) is
the generalization of a rectangle for higher dimensions, formally
View
2  Language/Paraiso/PiSystem.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE TypeOperators, FlexibleInstances, OverlappingInstances #-}
+{-# LANGUAGE CPP, TypeOperators, FlexibleInstances, OverlappingInstances #-}
{- | In mathematics, a pi-system is a non-empty family of sets that is closed
under finite intersections. -}
View
20 Language/Paraiso/Prelude.hs
@@ -1,35 +1,27 @@
-{-# LANGUAGE NoImplicitPrelude, NoMonomorphismRestriction, RankNTypes #-}
+{-# LANGUAGE CPP, NoImplicitPrelude, NoMonomorphismRestriction, RankNTypes #-}
{-# OPTIONS -Wall #-}
{-# OPTIONS_HADDOCK hide #-}
-- | an extension of the standard Prelude for paraiso.
module Language.Paraiso.Prelude
(
- module Control.Applicative,
- module Control.Monad,
- module Data.Foldable,
- module Data.Traversable,
- module NumericPrelude,
Boolean(..),
Text, showT,
(++)) where
-
+{-
import Control.Applicative (Applicative(..), (<$>))
import Control.Monad hiding
(mapM_, sequence_, forM_, msum, mapM, sequence, forM)
-import Data.Foldable
+-}
+
import Data.ListLike (append)
import Data.ListLike.Text ()
import qualified Data.ListLike.Base (ListLike)
import qualified Data.Text as Text
-import Data.Traversable
-import NumericPrelude hiding
- (not, (&&), (||), Monad, Functor, (*>), (++),
- (>>=), (>>), return, fail, fmap, mapM, mapM_, sequence, sequence_,
- (=<<), foldl, foldl1, foldr, foldr1, and, or, any, all, sum, product,
- concat, concatMap, maximum, minimum, elem, notElem)
import qualified NumericPrelude as Prelude
+import NumericPrelude hiding ((++))
+
-- | An efficient String that is used thoroughout Paraiso modules.
type Text = Text.Text
View
25 Language/Paraiso/Tuning/Genetic.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving, NoImplicitPrelude, PackageImports #-}
+{-# LANGUAGE CPP, GeneralizedNewtypeDeriving, NoImplicitPrelude, PackageImports #-}
{-# OPTIONS -Wall #-}
module Language.Paraiso.Tuning.Genetic
(
@@ -20,9 +20,10 @@ import qualified Language.Paraiso.Generator.Native as Native
import qualified Language.Paraiso.OM as OM
import qualified Language.Paraiso.OM.Graph as OM
import qualified Language.Paraiso.Optimization as Opt
-import Language.Paraiso.Prelude
+import Language.Paraiso.Prelude hiding (Boolean(..))
import qualified Language.Paraiso.Generator as Gen (generateIO)
import qualified Prelude as Prelude
+import NumericPrelude hiding ((++))
import System.Random
import qualified Text.Read as Read
@@ -204,7 +205,7 @@ putInt bit n
where
val :: Int
val = 2^(fromIntegral $ bit-1)
-
+
getInt :: Int -> Get Int
getInt bit
| bit <= 0 = return 0
@@ -224,23 +225,23 @@ putGraph graph = do
-- idxNodes :: V.Vector (FGL.Node, OM.Node v g a)
idxNodes = V.fromList $ FGL.labNodes graph
-
+
hasChoice :: Anot.Annotation -> Bool
hasChoice anot =
case Anot.toMaybe anot of
Just (Alloc.AllocationChoice _) -> True
_ -> False
-
+
isManifest :: Anot.Annotation -> Bool
isManifest anot =
case Anot.toMaybe anot of
Just Alloc.Manifest -> True
_ -> False
-
+
focus2 =
V.map (getSyncBools . OM.getA . snd) $
V.filter (isValue . snd) idxNodes
-
+
isValue nd = case nd of
OM.NValue _ _ -> True
_ -> False
@@ -248,7 +249,7 @@ putGraph graph = do
getSyncBools :: Anot.Annotation -> (Bool, Bool)
getSyncBools xs = let ys = Anot.toList xs in
(Sync.Pre `elem` ys, Sync.Post `elem` ys)
-
+
put2 (a,b) = put a >> put b
@@ -284,13 +285,13 @@ overwriteGraph graph = do
V.filter (isValue . snd) idxNodes
idxNodes = V.fromList $ FGL.labNodes graph
-
+
hasChoice :: Anot.Annotation -> Bool
hasChoice anot =
case Anot.toMaybe anot of
Just (Alloc.AllocationChoice _) -> True
_ -> False
-
+
isManifest :: Anot.Annotation -> Bool
isManifest anot =
case Anot.toMaybe anot of
@@ -330,13 +331,13 @@ overwriteGraph graph = do
anots :: V.Vector (FGL.Node, Anot.Annotation)
anots = V.fromList $ map (\(n, lab) -> (n, OM.getA lab)) $ FGL.labNodes graph
-
+
hasChoice :: Anot.Annotation -> Bool
hasChoice anot =
case Anot.toMaybe anot of
Just (Alloc.AllocationChoice _) -> True
_ -> False
-
+
isManifest :: Anot.Annotation -> Bool
isManifest anot =
case Anot.toMaybe anot of
View
5 Paraiso.cabal
@@ -15,7 +15,7 @@ Name: Paraiso
-- The package version. See the Haskell package versioning policy
-- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
-- standards guiding when and how versions should be incremented.
-Version: 0.2.0.0
+Version: 0.2.0.1
-- A short (one-line) description of the package.
Synopsis: a code generator for partial differential equations solvers.
@@ -88,6 +88,7 @@ Build-type: Simple
Cabal-version: >=1.10
+
flag test
description: Build the executable to run unit tests
default: True
@@ -157,7 +158,6 @@ Library
-- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source.
-- Build-tools:
-
ghc-options: -O3 -Wall -fspec-constr-count=25
@@ -192,7 +192,6 @@ test-suite runtests
HUnit,
QuickCheck >= 2 && < 3
main-is: runtests.hs
-
ghc-options: -Wall -O3 -fspec-constr-count=25
Default-Language: Haskell2010
View
5 include/numeric-prelude-restricted.hs
@@ -0,0 +1,5 @@
+import NumericPrelude hiding
+ (not, (&&), (||), Monad, Functor, (*>), (++),
+ (>>=), (>>), return, fail, fmap, mapM, mapM_, sequence, sequence_,
+ (=<<), foldl, foldl1, foldr, foldr1, and, or, any, all, sum, product,
+ concat, concatMap, maximum, minimum, elem, notElem)
Please sign in to comment.
Something went wrong with that request. Please try again.