ClojureCL and ClojureCUDA have been doing it for 4 years now.
(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?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.