News for hackers. Stuff that matters.
Re:An Introduction to GPU Programming in Julia by dragandj on Thursday October 18, 2018 @04:38PM (#18251898)
ClojureCL and ClojureCUDA have been doing it for 4 years now.

https://clojurecl.uncomplicate.org

https://clojurecuda.uncomplicate.org

Re:An Introduction to GPU Programming in Julia by KenoFischer on Thursday October 18, 2018 @05:03PM (#18252098)
Am I missing something? I was excited about other languages doing the same as Julia, but the first example for ClojureCUDA has

    (def kernel-source
          "extern \"C\"
             __global__ void increment (int n, float *a) {
                   int i = blockIdx.x * blockDim.x + threadIdx.x;
               if (i < n) {
                  a[i] = a[i] + 1.0f;
                }
           };")
Is there an example where the kernel is written in Clojure?
Re:An Introduction to GPU Programming in Julia by dragandj on Thursday October 18, 2018 @06:16PM (#18252640)
You can of course create Clojure/lisp code that would generate kernel code, but I am strongly against it as the default option, since I find plain C much better suited to small kernels close to hardware (which are only a small proportion of the overall code) than either lisp or Julia.

Please note that there is no need for out-of process compilation step. You compile this by calling a Clojure function, interactively from the REPL.

Re:An Introduction to GPU Programming in Julia by KenoFischer on Thursday October 18, 2018 @06:30PM (#18252763)
Sure, but that's a completely separate thing from what Julia is doing here. The whole point of the GPU backend is that you get almost the full flexibility of the Julia language at your disposal, without having to fall back to C code. As a result, not only is your code more familiar to Julia programmers, but you also get to share large amounts of code between CPU/GPU/TPU. If all you're doing is super small kernels that may not matter much, but GPUs are so powerful these days that it's perfectly sensible to offload rather large programs that you may not want to write in C anymore.
Re:An Introduction to GPU Programming in Julia by 3rdAccount on Thursday October 18, 2018 @07:56PM (#18253352)
It's not just easier to read for Julia programmers. Any pythonista can mostly read Julia without significant issue. They're both high level and syntactically similar enough. I know Python is a lot more OO, but when you're just writing a short script it looks a lot like Julia if Julia didn't need you to specify types.
Re:An Introduction to GPU Programming in Julia by byt143 on Thursday October 18, 2018 @07:05PM (#18253074)
Also that exact C example can be written almost verbatim in Julia, so C isn't "better suited" for even these small kernels, because one can drop to low level with even clearer syntax in julia