On 19/10/2012 1:03 AM, John Mija wrote:

On 17/10/12 20:09, John Mija wrote:
Since Rust compiles down to LLVM and OpenCL is also built on LLVM
compiler technology, could be used the GPU from Rust? Which would be
perfect to build games and graphical applications in general that
require a lot of processing.
Does anybody could say if it could be possible any day? Due to that both
compilers use LLVM.

There's no support for this in rustc presently, nor do Mozilla engineers have it on our near-term roadmap for language work _we're_ planning to do in the next couple releases. There's nothing about it that's intrinsically impossible -- certainly we've talked a bit about it and a number of people have expressed interest -- but we haven't committed any of our own resources to exploring it yet.

Exploratory patches in this area, if they aren't too disruptive to the rest of the compiler, might be something we'd merge into our branch. For example, hooking up to LLVM's JIT wasn't a _high_ priority for 0.4, but Zack Corr decided to tackle it and it turned out to work without too much disruption, so we merged it into our branch too. If someone's really keen to start playing around with a concrete version of an OpenCL binding or embedding, please let us know.

(Personally I suspect the best way to approach this is in separate steps: first make a binding to the OpenCL runtime using the C API for transferring data and loading/activating kernels explicitly from Rust, then start tinkering with possible language subsets for defining kernels in rust and/or automating portions of the data-transfer. But there's a lot of experimentation to do here, I might be completely wrong. I've actually never programmed in OpenCL, so take my advice with suspicion.)

-Graydon

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to