AccelerateHS / AccelerateHS/accelerate

Passing arguments to kernels as values

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

説明

I see that if I have a function:

```
f :: Acc (Scalar (Float, Float, Float, Float)) -> Acc (Array sh Float) -> Acc (Array sh Float)
```

The generated kernel signature will look like:

```
__global__ void fun(float* arg1, float* arg2, float* arg3, float* arg4, float* arg5, float* arr1, float* out)
```

All of the scalar arguments are passed as pointers to the device allocated memory. This has a couple of consequences at runtime: each of these arguments needs to be allocated, memcpy'd, put into memory table/nursery, and then evicted from the memory. Furthermore, because of chunked allocations, even if we are marshalling a 4 byte Float, 4kB are allocated. I think that it is non-optimal, because of all the allocations and copying.

Would it be possible to implement passing small arguments as values so that we can avoid the overhead? If you could give a couple of pointers, I'd take a look at this.

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

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

評価

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

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

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