Stability | experimental |
---|---|
Maintainer | developer@flocc.net |
Safe Haskell | None |
For more information please see http://www.flocc.net/
- data ArrTy
- data ArrStor
- data ConstArrSz = ConstArrSz [Int]
- type ArrSzTy = String
- arrSzLit :: Int -> ArrSzTy
- arrSzExp :: ArrSzTy -> Code
- data IdxSpace = IdxSpace {
- idxStartExps :: [ArrSzTy]
- idxLimitExps :: [ArrSzTy]
- idxLenExps :: [ArrSzTy]
- idxStridExps :: [ArrSzTy]
- spaceNumDims :: IdxSpace -> Int
- createSpaceFromLens :: [ArrSzTy] -> [ArrSzTy] -> [ArrSzTy] -> IdxSpace
- createSpaceFromLims :: [ArrSzTy] -> [ArrSzTy] -> [ArrSzTy] -> IdxSpace
- data ArrRec = ArrRec {}
- data ArrIterTy
- = IterOffset
- | IterStrided
- | IterDimsZero
- | IterDims
- data ArrIter
- = ArrIterBase {
- arrIterTy :: ArrIterTy
- arrIterExps :: [Code]
- arrIterIdxs :: IdxSpace
- | ArrIterDerv {
- arrIterTy :: ArrIterTy
- arrIterExps :: [Code]
- = ArrIterBase {
- zeros :: Int -> [ArrSzTy]
- ones :: Int -> [ArrSzTy]
- createArr :: Monad m => ArrTy -> ArrStor -> IdxSpace -> Id -> GenM1 m (ArrRec, Id, Code)
- isRangeValid :: ArrSzTy -> ArrSzTy -> ArrSzTy -> ArrSzTy -> Code
- zip4Err :: (Show a, Show b, Show c, Show d) => [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
- isSpaceValid :: IdxSpace -> Code
- type IdxRange = (ArrSzTy, ArrSzTy, ArrSzTy, ArrSzTy)
- isRangeSubset :: (IdxRange, IdxRange) -> Code
- isSpaceSubset :: IdxSpace -> IdxSpace -> Code
- spaceEqPredicate :: IdxSpace -> IdxSpace -> Code
- declareIter :: ArrIter -> Code
- createArrIter :: Monad m => ArrRec -> IdxSpace -> GenM1 m (Code, ArrIter)
- accessElement :: ArrRec -> ArrIter -> Code
- printLoopNests :: [(Code, Code)] -> Code
- createArrMpiType :: Monad m => ArrRec -> IdxSpace -> Id -> Id -> GenM1 m (Code, [Id])
- decCInt :: Monad m => String -> Code -> GenM1 m (Code, Id)
- unpair :: [[(a, b)]] -> ([a], [[b]])
- binOp :: Code -> (Code, Code) -> Code
- zipErr :: Show a => Show b => [a] -> [b] -> [(a, b)]
- convertIdxSpace :: IdxSpace -> ArrIterTy -> ArrIterTy -> IdxSpace -> IdxSpace
- deriveArrIter :: IdxSpace -> ArrIterTy -> ArrIter -> ArrIter
- removeRepeats :: Eq a => [a] -> [[a]] -> [[a]]
- defaultLoopDims :: Int -> [[(Int, Int)]]
- genLoops :: [ArrIter] -> [[(Int, Int)]] -> [(Code, Code)]
- dimAt :: Show a => Int -> [a] -> a
- genLoop :: [ArrIter] -> [(Int, Int)] -> (Code, Code)
Documentation
data ArrTy
The type of array |Jagged is accessed using IterDimZero |Cont is accedded using IterOffset
data ArrStor
The type of array storage
data IdxSpace
Represents an index space to iterate over.
IdxSpace | |
|
spaceNumDims :: IdxSpace -> Int
createSpaceFromLens :: [ArrSzTy] -> [ArrSzTy] -> [ArrSzTy] -> IdxSpace
createSpaceFromLens starts lens strids. Creates a new Index space |using lens, and works out limits based on them.
createSpaceFromLims :: [ArrSzTy] -> [ArrSzTy] -> [ArrSzTy] -> IdxSpace
createSpaceFromLims starts lims strids. Creates a new Index space |using lims, and works out lengths based on them.
data ArrIterTy
The type of array iterator
data ArrIter
Information about a particular array iterator.
ArrIterBase | |
| |
ArrIterDerv | |
|
isRangeValid :: ArrSzTy -> ArrSzTy -> ArrSzTy -> ArrSzTy -> Code
isRangeValid start lim len strid. Returns code that throws an |error if this index range is invalid.
zip4Err :: (Show a, Show b, Show c, Show d) => [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
zip4Err al bl cl dl. Zips together 4 lists, throwing an error if they differ in length.
isSpaceValid :: IdxSpace -> Code
isIdxSpaceValid space. Returns true if the lengths match the |limits, and false otherwise.
isRangeSubset :: (IdxRange, IdxRange) -> Code
isRangeSubset (ran1,ran2). Returns code that checks if ran2 is a subset of ran1, |and throws an error if it isn't.
isSpaceSubset :: IdxSpace -> IdxSpace -> Code
isSpaceSubset space subSpace. If subspace is not a subset of space |then throws an error.
spaceEqPredicate :: IdxSpace -> IdxSpace -> Code
spaceEqPredicate a b. Returns code to compare two IdxSpaces returning true |iff they are identical.
declareIter :: ArrIter -> Code
declareIter iter. Returns code that declares the iterator |variables, and assigns the iterator's start values to them.
createArrIter :: Monad m => ArrRec -> IdxSpace -> GenM1 m (Code, ArrIter)
createArrIter arr itSpace. Returns a new iterator, to loop |over the subarray, and the code to declare it.
accessElement :: ArrRec -> ArrIter -> Code
accessElement arr iter. Returns an expression for accessing the |element at the iterator's current position in the array.
printLoopNests :: [(Code, Code)] -> Code
printLoopNests l. Prints l as a nested tree with the first pair |starting and finishing the whole block, and the last pair at the middle.s
createArrMpiType :: Monad m => ArrRec -> IdxSpace -> Id -> Id -> GenM1 m (Code, [Id])
createArrMpiType arr space elTyVid arrTyVid. Returns code to generate |the MPI data type for a sub-array. Note: returned vars should be freed using delete [] |when the datatype is nolonger needed.
unpair :: [[(a, b)]] -> ([a], [[b]])
binOp :: Code -> (Code, Code) -> Code
convertArrIter arr iter newIterTy. Takes one type of |of iterator, and returns another iterator that iterates over |the same space
convertIdxSpace :: IdxSpace -> ArrIterTy -> ArrIterTy -> IdxSpace -> IdxSpace
convertIdxSpace arrSpace iterSpace inTy outTy. Converts an iterater space iterSpace |iterating over a subset of an array with space arrSpace, from inTy to outTy. |Note: conversions to and from IterOffset are only allowed if iterSpace |and arrSpace only have one dimension.
deriveArrIter :: IdxSpace -> ArrIterTy -> ArrIter -> ArrIter
deriveArrIter idxSpace targetIterType inputIter. Creates a new iterator |from the original, by creating expressions for the new indices in terms |of the input.
removeRepeats :: Eq a => [a] -> [[a]] -> [[a]]
removeRepeats [] llist. Removes all repeats of |an element found in an earlier sublist, from all |the sublists that follow it.
defaultLoopDims :: Int -> [[(Int, Int)]]
defaultLoopDims numDims. Creates default loop dims for |looping over a single array space with numDims dims.
genLoops :: [ArrIter] -> [[(Int, Int)]] -> [(Code, Code)]
genLoops iters loopsDims. Generates a list of (nested) for loops, one for |each element in loopsDims. Each element of loopDims defines a number of iterator dims |(fst is iter idx, snd is iter's dim idx) that are to be iterated over in-step in a single |for-loop. |Note: Can't loop over a derived iterator.