AccelerateHS / AccelerateHS/accelerate

Support for "combining" operators

Abierto
#6 1 comentario 0 reacciones 0 asignados Ver en GitHub
new feature
Lenguaje dominante
Haskell
Estrellas
1k
Forks
135
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Originally suggested by @blever**

The ability to combine multiple arrays into a single one can currently only be achieved using zip/zipWith. Of course, these arrays can only combine 2 arrays at a time, so in general it would be useful to have operators for combining more than 2 arrays in more elaborate, but structured, ways.

Some requirements could be:
- 'combine' operator:
- a generalised array combining operator
- sum of input arrays sizes is equal to output array size - i.e. no elements are lost or duplicated
- no permutation is performed on elements within in input array - i.e. output array elements are contiguous with respect to their source input array
- input array elements must all be of the same type and shape (shape would need to be a run-time check)
- the combination does not need to preserve dimensionality - e.g. multiple 1D arrays could be combined to produce another 1D array (concatenation), or a 2D array (stacked) or even "maybe" a 3D array (stack-stacking?)
- 'append' operator:
- a specialised array combining operator
- two input arrays - place one array at the "end" of the other
- input array elements of the same type
- the higher dimensions of the input arrays must have the same extent

In addition to fulfilling the need of a common pattern, combining operators would allow for further backend optimisations:
- input arrays to a combine operator would not require intermediate writing to memory - they can be written directly (by their producer) to their location within the combined output array
- on architectures such as Fermi, the generation of the input arrays can be done in parallel by using separate streams - 'combine' in this case acts as synchronisation barrier until all computations are complete

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.