GPU programming on Clojure?

做~自己de王妃 提交于 2019-12-04 20:37:20

问题


I'm wondering what if any GPU integration libraries exist for Clojure?

I've seen examples of this that involve hand-rolling OpenCL code, but I'm specifically I'm looking for something similar to Anacoda accelerate, which translates Numpy Python expressions to CUDA code relatively seamlessly.

I'm open to either OpenCL or Cuda approaches.


回答1:


here is a project that recently started on github https://github.com/JulesGosnell/clumatra. Its seems more like an experiment and its quite impressive!




回答2:


There is a Google Summer of Code project proposal to add a GPU matrix implementation to core.matrix:

  • http://dev.clojure.org/display/community/Project+Ideas

Once completed, this project would allow large vector/matrix expressions to be optimised and executed on GPUs.

Disclaimer: I'm a possible mentor for this project.




回答3:


clojureCL was released a few months after this question was posted. It looks like it offers a more idiomatic interpretation of the standard interface, but it is not a tool that would transform Clojure math / vector operations into OpenCL operations (I think that that is what the OP is looking for?)

[ClojureCL] brings a lot of power, but do not expect it to be an easy ride if you’ve never programmed anything on the GPU or embedded devices. With ClojureCL, it is not [as] difficult as in C (OpenCL Hello World in C is a hundred lines of source code, in ClojureCL it’s only a few), ...

The good news is that you can use any OpenCL book to learn ClojureCL, and we even provide ClojureCL code for the examples used in the OpenCL in Action book.




回答4:


An old topic but now we have clojurecuda, which is a wrapper on JCuda!

It won't give you automagic speedup on things but at least Neanderthal is a higher level library for linear algebra.



来源:https://stackoverflow.com/questions/22312905/gpu-programming-on-clojure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!