AccelerateHS / AccelerateHS/accelerate

Support for "combining" operators

オープン
#6 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
new feature
主要言語
Haskell
スター
1k
フォーク
135
PR マージ指標
30日以内にマージされた PR はありません

説明

**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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。