knead-0.3: Repa-like array processing using LLVM JIT

Safe HaskellNone

Data.Array.Knead.Shape.Nested

Synopsis

Documentation

class (C sh, C (Index sh)) => C sh whereSource

Associated Types

type Index sh :: *Source

Methods

intersectCode :: T sh -> T sh -> CodeGenFunction r (T sh)Source

sizeCode :: T sh -> CodeGenFunction r (Value Size)Source

size :: sh -> IntSource

flattenIndexRec :: T sh -> T (Index sh) -> CodeGenFunction r (Value Size, Value Size)Source

Result is (size, flattenedIndex). size must equal the result of sizeCode. 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

Instances

C Int8 
C Int16 
C Int32 
C Int64 
C Word32 
C Word64 
C () 
(Integral n, ToSize n, Comparison n) => C (Shifted n) 
(Integral n, ToSize n, Comparison n) => C (Range n) 
(C n, C m) => C (n, m) 
(~ * tag ShapeTag, C sh) => C (T tag sh) 
(C n, C m, C l) => C (n, m, l) 

value :: (C sh, Value val) => sh -> val shSource

paramWith :: (Storable b, C b, Value val) => T p b -> (forall parameters. (Storable parameters, C parameters) => (p -> parameters) -> (T parameters -> val b) -> a) -> aSource

load :: C sh => f sh -> Value (Ptr (Struct sh)) -> CodeGenFunction r (T sh)Source

intersect :: C sh => Exp sh -> Exp sh -> Exp shSource

flattenIndex :: C sh => T sh -> T (Index sh) -> CodeGenFunction r (Value Size)Source

data Range n Source

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 Arrays.

Constructors

Range n n 

Instances

Storable n => Storable (Range n) 
C n => C (Range n) 
C n => C (Range n) 
Compose n => Compose (Range n) 
Decompose pn => Decompose (Range pn) 
(Integral n, ToSize n, Comparison n) => C (Range n) 

data Shifted n Source

Shifted denotes a range defined by the start index and the length.

Constructors

Shifted 

Fields

shiftedOffset :: n
 
shiftedSize :: n
 

Instances

Storable n => Storable (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) 

class C sh => Scalar sh whereSource

Methods

scalar :: Value val => val shSource

zeroIndex :: Value val => f sh -> val (Index sh)Source

Instances

Scalar () 
(~ * tag ShapeTag, ~ * sh Z) => Scalar (T tag sh)