repa-3.1.1.1: High performance, regular, shape polymorphic parallel arrays.

Safe HaskellSafe-Infered

Data.Array.Repa.Repr.ForeignPtr

Synopsis

Documentation

data F Source

Arrays represented as foreign buffers in the C heap.

Instances

Storable a => Repr F a

Read elements from a foreign buffer.

Storable e => Fillable F e

Filling of foreign buffers.

Storable a => Combine F a D b 

data family Array r sh e Source

Arrays with a representation tag, shape, and element type. Use one of the type tags like D, U and so on for r, one of DIM1, DIM2 ... for sh.

fromForeignPtr :: Shape sh => sh -> ForeignPtr e -> Array F sh eSource

O(1). Wrap a ForeignPtr as an array.

toForeignPtr :: Array F sh e -> ForeignPtr eSource

O(1). Unpack a ForeignPtr from an array.

computeIntoS :: Fill r1 F sh e => ForeignPtr e -> Array r1 sh e -> IO ()Source

Compute an array sequentially and write the elements into a foreign buffer without intermediate copying. If you want to copy a pre-existing manifest array to a foreign buffer then delay it first.

computeIntoP :: Fill r1 F sh e => ForeignPtr e -> Array r1 sh e -> IO ()Source

Compute an array in parallel and write the elements into a foreign buffer without intermediate copying. If you want to copy a pre-existing manifest array to a foreign buffer then delay it first.