Safe Haskell | None |
---|
- class (C sh, C (Index sh), Indexed sh) => C sh where
- intersectCode :: T sh -> T sh -> CodeGenFunction r (T sh)
- size :: T sh -> CodeGenFunction r (Value Size)
- sizeOffset :: T sh -> CodeGenFunction r (Value Size, T (Index sh) -> CodeGenFunction r (Value Size))
- iterator :: Index sh ~ ix => T sh -> T r (T ix)
- loop :: (Index sh ~ ix, C ix, Phi state) => (T ix -> state -> CodeGenFunction r state) -> T sh -> state -> CodeGenFunction r state
- type family Index sh :: *
- type Size = Word64
- value :: (C sh, Value val) => sh -> val sh
- paramWith :: (Storable b, C b, Value val) => T p b -> (forall parameters. (Storable parameters, C parameters) => (p -> parameters) -> (T parameters -> val b) -> a) -> a
- load :: C sh => f sh -> Value (Ptr (Struct sh)) -> CodeGenFunction r (T sh)
- intersect :: C sh => Exp sh -> Exp sh -> Exp sh
- offset :: C sh => T sh -> T (Index sh) -> CodeGenFunction r (Value Size)
- newtype ZeroBased n = ZeroBased n
- zeroBased :: Value val => val n -> val (ZeroBased n)
- zeroBasedSize :: Value val => val (ZeroBased n) -> val n
- data Range n = Range n n
- range :: Value val => val n -> val n -> val (Range n)
- rangeFrom :: Value val => val (Range n) -> val n
- rangeTo :: Value val => val (Range n) -> val n
- data Shifted n = Shifted n n
- shifted :: Value val => val n -> val n -> val (Shifted n)
- shiftedOffset :: Value val => val (Shifted n) -> val n
- shiftedSize :: Value val => val (Shifted n) -> val n
- data Enumeration n = Enumeration
- class (Enum enum, Bounded enum) => EnumBounded enum where
- enumOffset :: T enum -> CodeGenFunction r (Value Size)
- class C sh => Scalar sh where
- class (C sh, IntegerConstant (Index sh), Additive (Index sh)) => Sequence sh where
- sequenceShapeFromIndex :: T (Index sh) -> CodeGenFunction r (T sh)
Documentation
class (C sh, C (Index sh), Indexed sh) => C sh whereSource
intersectCode :: T sh -> T sh -> CodeGenFunction r (T sh)Source
size :: T sh -> CodeGenFunction r (Value Size)Source
sizeOffset :: T sh -> CodeGenFunction r (Value Size, T (Index sh) -> CodeGenFunction r (Value Size))Source
Result is (size, offset)
.
size
must equal the result of size
.
We use this for sharing intermediate results.
iterator :: Index sh ~ ix => T sh -> T r (T ix)Source
loop :: (Index sh ~ ix, C ix, Phi state) => (T ix -> state -> CodeGenFunction r state) -> T sh -> state -> CodeGenFunction r stateSource
C () | |
(Integral n, ToSize n, Comparison n) => C (ZeroBased n) | Array dimensions and indexes cannot be negative, but computations in indices may temporarily yield negative values or we want to add negative values to indices. So maybe, we would better have type Index (ZeroBased Word64) = Int64. This is not possible. Maybe we need an additional ZeroBased type for unsigned array sizes. |
(Ix n, ToSize n, Comparison n) => C (Range n) | |
(Integral n, ToSize n, Comparison n) => C (Shifted n) | |
(Enum enum, Bounded enum, EnumBounded enum) => C (Enumeration enum) | |
(C n, C m) => C (n, m) | |
C sh => C (Tagged tag sh) | |
(~ * tag ShapeTag, C sh) => C (T tag sh) | |
(C n, C m, C l) => C (n, m, l) |
type family Index sh :: *
paramWith :: (Storable b, C b, Value val) => T p b -> (forall parameters. (Storable parameters, C parameters) => (p -> parameters) -> (T parameters -> val b) -> a) -> aSource
newtype ZeroBased n
ZeroBased
denotes a range starting at zero and has a certain length.
Functor ZeroBased | |
Applicative ZeroBased | |
Eq n => Eq (ZeroBased n) | |
Show n => Show (ZeroBased n) | |
Storable n => Storable (ZeroBased n) | |
Integral n => C (ZeroBased n) | |
Integral n => Indexed (ZeroBased n) | |
Integral n => InvIndexed (ZeroBased n) | |
NFData n => NFData (ZeroBased n) | |
C n => C (ZeroBased n) | |
C n => C (ZeroBased n) | |
Compose n => Compose (ZeroBased n) | |
Decompose pn => Decompose (ZeroBased pn) | |
Decompose pn => Decompose (ZeroBased pn) | |
Compose n => Compose (ZeroBased n) | |
(Integral n, ToSize n, Comparison n) => Sequence (ZeroBased n) | |
(Integral n, ToSize n, Comparison n) => C (ZeroBased n) | Array dimensions and indexes cannot be negative, but computations in indices may temporarily yield negative values or we want to add negative values to indices. So maybe, we would better have type Index (ZeroBased Word64) = Int64. This is not possible. Maybe we need an additional ZeroBased type for unsigned array sizes. |
zeroBasedSize :: Value val => val (ZeroBased n) -> val nSource
data Range n
Range
denotes an inclusive range like
those of the Haskell 98 standard Array
type from the array
package.
E.g. the shape type (Range Int32, Range Int64)
is equivalent to the ix type (Int32, Int64)
for Array
s.
Range n n |
Functor Range | |
Eq n => Eq (Range n) | |
Show n => Show (Range n) | |
Storable n => Storable (Range n) | |
Ix n => C (Range n) | |
Ix n => Indexed (Range n) | |
Ix n => InvIndexed (Range n) | |
NFData n => NFData (Range n) | |
C n => C (Range n) | |
C n => C (Range n) | |
Compose n => Compose (Range n) | |
Decompose pn => Decompose (Range pn) | |
(Ix n, ToSize n, Comparison n) => C (Range n) |
data Shifted n
Shifted
denotes a range defined by the start index and the length.
Shifted n n |
Functor Shifted | |
Eq n => Eq (Shifted n) | |
Show n => Show (Shifted n) | |
Storable n => Storable (Shifted n) | |
Integral n => C (Shifted n) | |
Integral n => Indexed (Shifted n) | |
Integral n => InvIndexed (Shifted n) | |
NFData n => NFData (Shifted n) | |
C n => C (Shifted n) | |
C n => C (Shifted n) | |
Compose n => Compose (Shifted n) | |
Decompose pn => Decompose (Shifted pn) | |
(Integral n, ToSize n, Comparison n) => C (Shifted n) |
shiftedOffset :: Value val => val (Shifted n) -> val nSource
shiftedSize :: Value val => val (Shifted n) -> val nSource
data Enumeration n
Enumeration
denotes a shape of fixed size
that is defined by Enum
and Bounded
methods.
For correctness it is necessary that the Enum
and Bounded
instances
are properly implemented.
Automatically derived instances are fine.
Eq (Enumeration n) | |
Show (Enumeration n) | |
Storable (Enumeration n) | |
(Enum n, Bounded n) => C (Enumeration n) | |
(Enum n, Bounded n) => Indexed (Enumeration n) | |
(Enum n, Bounded n) => InvIndexed (Enumeration n) | |
(Enum n, Bounded n) => Static (Enumeration n) | |
NFData (Enumeration n) | |
(Enum enum, Bounded enum) => C (Enumeration enum) | |
(Enum enum, Bounded enum) => C (Enumeration enum) | |
(Enum enum, Bounded enum) => Compose (Enumeration enum) | |
Decompose (Enumeration enum) | |
Decompose (Enumeration enum) | |
(Enum enum, Bounded enum) => Compose (Enumeration enum) | |
(Enum enum, Bounded enum, EnumBounded enum) => C (Enumeration enum) |
class (Enum enum, Bounded enum) => EnumBounded enum whereSource
enumOffset :: T enum -> CodeGenFunction r (Value Size)Source
class (C sh, IntegerConstant (Index sh), Additive (Index sh)) => Sequence sh whereSource
sequenceShapeFromIndex :: T (Index sh) -> CodeGenFunction r (T sh)Source
(Integral n, ToSize n, Comparison n) => Sequence (ZeroBased n) |