Copyright | (c) Alexey Kuleshevich 2018-2019 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <lehins@yandex.ru> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data D = D
- delay :: Source r ix e => Array r ix e -> Array D ix e
- data DL = DL
- toLoadArray :: Load r ix e => Array r ix e -> Array DL ix e
- makeLoadArrayS :: Index ix => Sz ix -> e -> (forall m. Monad m => (ix -> e -> m Bool) -> m ()) -> Array DL ix e
- makeLoadArray :: Index ix => Comp -> Sz ix -> e -> (forall m. Monad m => Scheduler m () -> (ix -> e -> m Bool) -> m ()) -> Array DL ix e
- fromStrideLoad :: StrideLoad r ix e => Stride ix -> Array r ix e -> Array DL ix e
- data DS = DS
- toStreamArray :: Source r ix e => Array r ix e -> Array DS Ix1 e
- toSteps :: Array DS Ix1 e -> Steps Id e
- fromSteps :: Steps Id e -> Array DS Ix1 e
- data DI = DI
- toInterleaved :: Source r ix e => Array r ix e -> Array DI ix e
- fromInterleaved :: Array DI ix e -> Array D ix e
- data DW = DW
- data Window ix e = Window {
- windowStart :: !ix
- windowSize :: !(Sz ix)
- windowIndex :: ix -> e
- windowUnrollIx2 :: !(Maybe Int)
- insertWindow :: Source D ix e => Array D ix e -> Window ix e -> Array DW ix e
- getWindow :: Array DW ix e -> Maybe (Window ix e)
- dropWindow :: Array DW ix e -> Array D ix e
- makeWindowedArray :: Source r ix e => Array r ix e -> ix -> Sz ix -> (ix -> e) -> Array DW ix e
Delayed
Delayed Pull Array
Delayed representation.
Instances
delay :: Source r ix e => Array r ix e -> Array D ix e Source #
O(1) Conversion from a source array to D
representation.
Delayed Push Array
Delayed load representation. Also known as Push array.
Instances
:: Index ix | |
=> Sz ix | Size of the resulting array |
-> e | Default value to use for all cells that might have been ommitted by the writing function |
-> (forall m. Monad m => (ix -> e -> m Bool) -> m ()) | Writing function that described which elements to write into the target array. |
-> Array DL ix e |
Describe how an array should be loaded into memory sequentially. For parallelizable
version see makeLoadArray
.
Since: 0.3.1
:: Index ix | |
=> Comp | Computation strategy to use. Directly affects the scheduler that gets created for the loading function. |
-> Sz ix | Size of the resulting array |
-> e | Default value to use for all cells that might have been ommitted by the writing function |
-> (forall m. Monad m => Scheduler m () -> (ix -> e -> m Bool) -> m ()) | Writing function that described which elements to write into the target array. It accepts a scheduler, that can be used for parallelization, as well as a safe element writing function. |
-> Array DL ix e |
Specify how an array should be loaded into memory. Unlike makeLoadArrayS
, loading
function accepts a scheduler, thus can be parallelized. If you need an unsafe version
of this function see unsafeMakeLoadArray
.
Since: 0.4.0
fromStrideLoad :: StrideLoad r ix e => Stride ix -> Array r ix e -> Array DL ix e Source #
Convert an array that can be loaded with stride into DL
representation.
Since: 0.3.0
Delayed Stream Array
Delayed stream array that represents a sequence of values that can be loaded sequentially. Important distinction from other arrays is that its size might no be known until it is computed.
Instances
toStreamArray :: Source r ix e => Array r ix e -> Array DS Ix1 e Source #
Flatten an array into a stream of values.
Since: 0.4.1
toSteps :: Array DS Ix1 e -> Steps Id e Source #
O(1) - Convert delayed stream array into Steps
.
Since: 0.4.1
fromSteps :: Steps Id e -> Array DS Ix1 e Source #
O(1) - Convert Steps
into delayed stream array
Since: 0.4.1
Delayed Interleaved Array
Delayed array that will be loaded in an interleaved fashion during parallel computation.
Instances
toInterleaved :: Source r ix e => Array r ix e -> Array DI ix e Source #
Convert a source array into an array that, when computed, will have its elemets evaluated out of order (interleaved amongst cores), hence making unbalanced computation better parallelizable.
fromInterleaved :: Array DI ix e -> Array D ix e Source #
O(1) - Unwrap the interleved array.
Since: 0.2.1
Delayed Windowed Array
Delayed Windowed Array representation.
Instances
Window | |
|
:: Source D ix e | |
=> Array D ix e | Source array that will have a window inserted into it |
-> Window ix e | Window to place inside the delayed array |
-> Array DW ix e |
Inserts a Window
into a delayed array while scaling the window down if it doesn't fit inside
that array.
Since: 0.3.0
getWindow :: Array DW ix e -> Maybe (Window ix e) Source #
Get the Window
from a windowed array.
Since: 0.2.1
dropWindow :: Array DW ix e -> Array D ix e Source #
Drop the Window
from a windowed array.
Since: 0.3.0
:: Source r ix e | |
=> Array r ix e | Source array that will have a window inserted into it |
-> ix | Start index for the window |
-> Sz ix | Size of the window |
-> (ix -> e) | Indexing function foto use inside window |
-> Array DW ix e |
Construct a delayed windowed array by supply a separate element producing function for the interior of an array. This is very usful for stencil mapping, where interior function does not perform boundary checks, thus significantly speeding up computation process.
Since: 0.1.3