f package:repa

Arrays represented as foreign buffers in the C heap.
Parallel reduction of an array of arbitrary rank to a single scalar value. The first argument needs to be an associative sequential operator. The starting element must be neutral with respect to the operator, for example 0 is neutral with respect to (+) as 0 + a = a. These restrictions are required to support parallel evaluation, as the starting element may be used multiple times depending on the number of threads. Elements are reduced in row-major order. Applications of the operator are associated arbitrarily.
Sequential reduction of an array of arbitrary rank to a single scalar value. Elements are reduced in row-major order. Applications of the operator are associated arbitrarily.
Parallel reduction of the innermost dimension of an arbitray rank array. The first argument needs to be an associative sequential operator. The starting element must be neutral with respect to the operator, for example 0 is neutral with respect to (+) as 0 + a = a. These restrictions are required to support parallel evaluation, as the starting element may be used multiple times depending on the number of threads. Elements are reduced in the order of their indices, from lowest to highest. Applications of the operator are associatied arbitrarily.
>>> let c 0 x = x; c x 0 = x; c x y = y

>>> let a = fromListUnboxed (Z :. 2 :. 2) [1,2,3,4] :: Array U (Z :. Int :. Int) Int

>>> foldP c 0 a
AUnboxed (Z :. 2) (fromList [2,4])
Sequential reduction of the innermost dimension of an arbitrary rank array. Combine this with transpose to fold any other dimension. Elements are reduced in the order of their indices, from lowest to highest. Applications of the operator are associatied arbitrarily.
>>> let c 0 x = x; c x 0 = x; c x y = y

>>> let a = fromListUnboxed (Z :. 2 :. 2) [1,2,3,4] :: Array U (Z :. Int :. Int) Int

>>> foldS c 0 a
AUnboxed (Z :. 2) (fromList [2,4])
O(1). Wrap a function as a delayed array.
O(n). Convert a list to an unboxed vector array.
  • This is an alias for fromList with a more specific type.
O(1). Wrap an unboxed vector as an array.
Property tested for pair of unboxed random arrays with a given shape.
Property tested for pair of unboxed random arrays with a given shape.
Property tested for triple of unboxed random arrays with a given shape.
Property tested for triple of unboxed random arrays with a given shape.
Property tested for quadruple of unboxed random arrays with a given shape.
Property tested for quadruple of unboxed random arrays with a given shape.
Property tested for 5-tuple of unboxed random arrays with a given shape.
Property tested for 5-tuple of unboxed random arrays with a given shape.
Property tested for unboxed random arrays with a given shape.
Property tested for unboxed random arrays with a given shape.
Fill a block in a rank-2 array in parallel.
  • Blockwise filling can be more cache-efficient than linear filling for rank-2 arrays.
  • Coordinates given are of the filled edges of the block.
  • We divide the block into columns, and give one column to each thread.
  • Each column is filled in row major order from top to bottom.
Fill a block in a rank-2 array, sequentially.
  • Blockwise filling can be more cache-efficient than linear filling for rank-2 arrays.
  • The block is filled in row major order from top to bottom.
Fill something in parallel, using a separate IO action for each thread.
  • The array is split into linear chunks, and each thread linearly fills one chunk.
Fill something in parallel.
  • The array is split into linear chunks, and each thread linearly fills one chunk.
Fill a block in a rank-2 array in parallel.
  • Blockwise filling can be more cache-efficient than linear filling for rank-2 arrays.
  • Using cursor functions can help to expose inter-element indexing computations to the GHC and LLVM optimisers.
  • Coordinates given are of the filled edges of the block.
  • We divide the block into columns, and give one column to each thread.
  • Each column is filled in row major order from top to bottom.
Fill a block in a rank-2 array, sequentially.
  • Blockwise filling can be more cache-efficient than linear filling for rank-2 arrays.
  • Using cursor functions can help to expose inter-element indexing computations to the GHC and LLVM optimisers.
  • Coordinates given are of the filled edges of the block.
  • The block is filled in row major order from top to bottom.
Fill something in parallel.
  • The array is split into linear chunks and each thread fills one chunk.