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

Safe HaskellNone
LanguageHaskell98

Data.Array.Repa.Repr.ForeignPtr

Synopsis

Documentation

data F #

Arrays represented as foreign buffers in the C heap.

Instances

Storable a => Source F a #

Read elements from a foreign buffer.

Associated Types

data Array F sh a :: * #

Methods

extent :: Shape sh => Array F sh a -> sh #

index :: Shape sh => Array F sh a -> sh -> a #

unsafeIndex :: Shape sh => Array F sh a -> sh -> a #

linearIndex :: Shape sh => Array F sh a -> Int -> a #

unsafeLinearIndex :: Shape sh => Array F sh a -> Int -> a #

deepSeqArray :: Shape sh => Array F sh a -> b -> b #

Storable e => Target F e #

Filling foreign buffers.

Associated Types

data MVec F e :: * #

Methods

newMVec :: Int -> IO (MVec F e) #

unsafeWriteMVec :: MVec F e -> Int -> e -> IO () #

unsafeFreezeMVec :: sh -> MVec F e -> IO (Array F sh e) #

deepSeqMVec :: MVec F e -> a -> a #

touchMVec :: MVec F e -> IO () #

Storable a => Structured F a b # 

Associated Types

type TR F :: * #

Methods

smap :: Shape sh => (a -> b) -> Array F sh a -> Array (TR F) sh b #

szipWith :: (Shape sh, Source r c) => (c -> a -> b) -> Array r sh c -> Array F sh a -> Array (TR F) sh b #

data Array F # 
data Array F = AForeignPtr !sh !Int !(ForeignPtr a)
data MVec F # 
data MVec F = FPVec !Int !(ForeignPtr e)
type TR F # 
type TR F = D

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

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

toForeignPtr :: Array F sh e -> ForeignPtr e #

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

computeIntoS :: (Load r1 sh e, Storable e) => ForeignPtr e -> Array r1 sh e -> IO () #

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 :: (Load r1 sh e, Storable e) => ForeignPtr e -> Array r1 sh e -> IO () #

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.