AccelerateHS / AccelerateHS/accelerate

Mutable arrays / lower level interface

Đang mở
#86 11 bình luận 0 reaction 0 người được giao Xem trên GitHub
new feature
Ngôn ngữ chính
Haskell
Star
1k
Fork
135
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi,

I figured this would be a good place to post this.

For more memory reusing one could use a lower level interface bridging between accelerate and cuda. Something along the lines of:

ptr1 <- getDevicePtr $ use initialData
ptr2 <- getDevicePtr newDeviceArray
krn <- getKernel algorithm
result <- sequence . take steps . cycle $ [krn ptr1 ptr2, krn ptr2 ptr1]

Where krn p1 p2 would indicate p1 as input and p2 as output array.

In my case this is motivated by the fact that my kernel takes at most few hundred ms to execude, while the whole step with allocation takes a few seconds. With hundreds of steps and enough samples for statistics this is unacceptable (and obviously I'd love to do my stuff in haskell and not C++).

Would it be a difficult task to add this features? Or maybe there's another way of reusing memory? I tried keeping my loop in Acc, but it was no good either (according to -ddump-gc output arrays were reallocated anyway, and I couldn't do stuff between steps).

Thanks for your consideration
Jan Sikorski

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.