[rust-dev] spawn on top of OpenCL

Eric Holk eric.holk at gmail.com
Fri Apr 6 08:49:15 PDT 2012


Newer versions of CUDA do allow memory allocation on the GPU. Even if
you're not using CUDA, it should be possible to implement your own on-GPU
memory allocation. Doing recursion on the GPU isn't supported yet as far as
I know, but I suspect if you're clever there's a way to do it. At any rate,
GPUs are significantly more powerful with each generation, so many of these
restrictions will probably be relaxed in a few years.

I don't think Rust's spawn is a great fit for GPU programming though, since
the GPU style is to spawn thousands of identical threads. Rust spawn so far
seems to be used for fewer numbers of tasks that each are responsible for
different things. It's hard to be sure at this point though, since there is
not a lot a parallel Rust code in existence.

I think Rust will definitely grow a GPU computing story someday. I'm not
really sure what the best approach is. Rust's interface system seems to be
approaching the power needed to do something like Accelerate does for
Haskell. There may be some benefit in making GPU computing a more baked-in
part of the language though, although this is probably somewhat contrary to
Rust's overall design.

-Eric

On Fri, Apr 6, 2012 at 5:40 AM, David Rajchenbach-Teller <
dteller at mozilla.com> wrote:

> Quick note: writing GPU code and CPU code is extremely different. Things
> may have changed, but last time I checked, GPUs were very antagonistic
> to non-static memory management – which basically meant no stack and no
> memory allocation.
>
> For these reasons, I doubt that |spawn| can even be implemented on top
> of OpenCL. On the other hand, it is certainly possible to write a nice
> library of combinators for on-GPU computations. I suspect that
> Rust-style typeclasses can even be used to define generic algorithms
> that can be implemented both on-GPU and on-CPU.
>
> Cheers,
>  David
>
> On 4/6/12 11:21 AM, Mic wrote:
> > Hi,
> > In the next 3 years some GPUs will have 20 000 cores.
> >
> > Looking at this http://jogamp.org/jocl/www/ benchmark it is now a huge
> > difference between GPU and CPU code. In Aparapi
> >
> http://blogs.amd.com/developer/2011/09/14/i-dont-always-write-gpu-code-in-java-but-when-i-do-i-like-to-use-aparapi/you
> > write everything in Java.
> >
> > Any plans to make spawn on top of OpenCL
> > ( http://en.wikipedia.org/wiki/OpenCL ) so the user can choose by
> > running the application whether it would like to do it on CPU, GPU
> > or Hadoop?
> >
> > Cheers,
> >
> > On Tue, Apr 3, 2012 at 6:43 PM, Mic <mictadlo at gmail.com
> > <mailto:mictadlo at gmail.com>> wrote:
> >
> >     Hello,
> >     Any plans to make spawn on top of OpenCL
> >     ( http://en.wikipedia.org/wiki/OpenCL ) similar to:
> >     http://code.google.com/p/copperhead/
> >     http://deeplearning.net/software/theano/
> >
> >
> >
> >
> >
> > _______________________________________________
> > Rust-dev mailing list
> > Rust-dev at mozilla.org
> > https://mail.mozilla.org/listinfo/rust-dev
>
>
> --
> David Rajchenbach-Teller, PhD
>  Performance Team, Mozilla
>
>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20120406/05c5c18f/attachment-0001.html>


More information about the Rust-dev mailing list