Hi Sameer,
On Sunday 26 March 2017 03:14 PM, Sameer Deshmukh wrote:
> Hi Prasun,
>
> Here's an idea that I thought of.
>
> Is it possible to make ArrrayFire as a module like `Enumerable` so that
> any class that does an `include ArrayFireable` will get certain methods
> from ArrayFire that run on the GPU? This way, it can be extended to
> classes other than NMatrix too (if you can make it generic enough).
>
Yeah, its a very nice idea. I remember John suggested it last year that
he would have made NMatrix like Enumerable if rewritten to make it more
Ruby-friendly.
I have been studying about Enumerable implementation in Ruby[0]. I feel
certain features can be made like Enumerable like searching, sorting
because the ArrayFire api will allow us to do that.
However other features need to take care of casting, passing data from
GPU RAM to CPU RAM. And I may need to writing the kernels. I feel this
will be next to impossible for the summers[1] :( . And it will be too
slow. For JRuby, I even don't want to imagine writing the JNI.
What do you think?
Regards,
Prasun
[0].
https://github.com/ruby/ruby/blob/7c7444bcd3f40d0594aa24875f66519b6c53fccf/enumerator.c
[1].
https://github.com/prasunanand/resume/wiki/GSoC-2017-proposal#comparing-opencl-and-arrayfire