Hi there ,
I’ve been engaged on an experimental venture that allows writing CUDA kernels instantly in Go and compiling them to NVIDIA GPU code utilizing LLVM 22.
Undertaking:
Motivation
Most Go GPU options depend on cgo wrappers, exterior CUDA C++ code, or runtime bindings. I wished to discover whether or not Go could possibly be used as a local language for GPU kernel improvement by leveraging LLVM’s NVPTX backend.
What the venture does
-
Generates LLVM IR from Go code
-
Makes use of LLVM 22 for optimization and code era
-
Targets NVIDIA GPUs by the NVPTX backend
-
Permits CUDA-style kernel improvement in Go
-
Produces PTX code that may be executed by the CUDA driver
Instance
func VecAdd(a, b, c []float32) {
idx := cuda.ThreadIdxX()
c[idx] = a[idx] + b[idx]
}
Present Standing
The venture continues to be experimental, however core compilation performance is working. My purpose is to construct a extra full ecosystem for GPU programming in Go whereas studying extra about compiler design, LLVM internals, and GPU architectures.
Suggestions Welcome
I might respect suggestions from the Go neighborhood on:
If anybody has expertise with LLVM, TinyGo, GPU computing, or compiler improvement, I’d love to listen to your ideas.
Repository:
Thanks!

