knead-0.2.2: Repa array processing using LLVM JIT

Safe HaskellNone




class C sh => C sh whereSource

Associated Types

type Index sh :: *Source


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

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

size :: sh -> IntSource

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

Result is (size, flattenedIndex). size must equal the result of sizeCode. We use this for sharing intermediate results.

loop :: (Index sh ~ ix, Phi state) => (T ix -> state -> CodeGenFunction r state) -> T sh -> state -> CodeGenFunction r stateSource


C Int32

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.

Maybe we should better have type Index Word64 = Int64?

C Int64 
C Word32 
C Word64 
C () 
(Integral n, ToSize n) => C (Shifted n) 
(Integral n, ToSize 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

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.


Range n n 


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

data Shifted n Source

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




shiftedOffset :: n
shiftedSize :: n


C n => C (Shifted n) 
Compose n => Compose (Shifted n) 
Decompose pn => Decompose (Shifted pn) 
(Integral n, ToSize n) => C (Shifted n) 

class C sh => Scalar sh whereSource


scalar :: Value val => val shSource

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


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