News for hackers. Stuff that matters.
Re:Compiling Julia for NVIDIA GPUs by unfamiliar on Tuesday February 03, 2015 @02:46PM (#8992801)
Since I only have one GPU usually, I'm still waiting for the day I can do this:

    using CUDA

    # define a kernel
    @kernel function kernel_vadd(a, b, c)
        i = blockId_x() + (threadId_x()-1) * numBlocks_x()
        c[i] = a[i] + b[i]
    end

    # create some data
    dims = (3, 4)
    a = round(rand(Float32, dims) * 100)
    b = round(rand(Float32, dims) * 100)
    c = Array(Float32, dims)

    # execute!
    @cuda kernel_vadd(CuIn(a), CuIn(b), CuOut(c))

    # verify
    @show a+b == c

i.e. no set up, no "cuda context" (whatever that is), and no tear down afterwards. I understand that manual memory management is almost necessary with this application, but it seems that most of it could be automated in the most common case of "I have a couple of large arrays and a few operations I want to perform."
Re:Compiling Julia for NVIDIA GPUs by Lofkin on Tuesday February 03, 2015 @03:50PM (#8993257)
Writing backend agnostic code (CPU and GPU) jitted to fast LLVM is on the roadmap for python's Numba: https://github.com/numba/numba/issues/545

Currently supports both including multithreading. Its just he unified interface that is in the works.

Re:Compiling Julia for NVIDIA GPUs by jtth on Tuesday February 03, 2015 @05:14PM (#8993836)
Re:Compiling Julia for NVIDIA GPUs by tabacof on Tuesday February 03, 2015 @06:17PM (#8994223)
Torch7 has amazing GPU support. If you wanna send a tensor (array) to the GPU, you just type array:cuda(). All operations you do from now on will be on the GPU.

More involved example using a neural network: http://code.cogbits.com/wiki/doku.php?id=tutorial_cuda

Re:Compiling Julia for NVIDIA GPUs by th0ma5 on Tuesday February 03, 2015 @03:00PM (#8992897)
I have seen a couple of Clojure based GPU compilers, although they seemed to be sort of proof-of-concepts, and I'm not sure how general purpose they were. It would be nice to possibly get out of the mode of it being a whole other computer and compiler, but maybe that distinction is for the best for the time being.
Re:Compiling Julia for NVIDIA GPUs by ICWiener on Wednesday February 04, 2015 @03:27AM (#8995865)
Instead of @kernel and @cuda, you might want to use defkernel and with-cuda... See the example files for cl-cuda:

https://github.com/takagi/cl-cuda/blob/master/examples/vecto...

I though that Julia had macros, so I don't understand why what you propose is not possible (note to self: find time to learn Julia).

Re:Compiling Julia for NVIDIA GPUs by maleadt on Wednesday February 04, 2015 @03:41AM (#8995898)
It is definitely possible to do that in Julia. The reason a didn't yet is purely a manner of priorities, I first focused on wrapping the basic primitives (calling a kernel, marshalling arguments, etc) in a user-friendly way.
Re:Compiling Julia for NVIDIA GPUs by zevets on Tuesday February 03, 2015 @05:55PM (#8994085)
Have you tried thrust? For a limited but very useful set of operations, it is nearly that painless, as long as you don't mind a generous helping of C++ template boilerplate.

http://thrust.github.io/

For single GPU stuff, I find myself writing the performance critical kernels in cuda, and using thrust for nearly all the easy stuff.