23

I've googled for a while and the only useful infos are:

  • github.com/barnex/cuda5
  • mumax.github.io/

Unfortunately, the latest Arch Linux only provides CUDA 7.5 package, so the barnex's project may be not supported.

Arne Vansteenkiste recommends concurrency rather than pure Golang or Golang plus CUDA. What's more, there's someone says the same idea that "Wouldn't it be cool to start a goroutine on a GPU and communicate with it via channels?". I think both of these ideas are wonderful since I would like to change the existing code as little as possible instead of refactoring the whole program. Is the idea possible, or is there some documents introducing this topic in details?

Update

It seems that there's two bindings to HPC in Golang:

  • CUDA (< 6.0): github.com/barnex/cuda5
  • OpenCL: github.com/rainliu/gocl

Both of them are less documented, currently what I got is only Macro13's answer, very helpful, but it's more about java . So please help me some detailed materials in Golang. Thanks!

Community
  • 1
  • 1
Yang
  • 759
  • 2
  • 9
  • 30
  • 1
    As an alternative to CUDA, one could consider OpenCL. There is http://gocl.org/ (which is NOT affiliated in ANY way with jocl.org - they just copied the jocl.org website, basically), but I can't say how well it works or how well it is maintained. – Marco13 Feb 18 '16 at 13:59
  • @Marco13 Thanks! OpenCL is a good alternative, but gocl document is not detailed. Do you have any ideas about converting a "traditional" golang program to be GPU-friendly, please? The goroutine way? – Yang Feb 18 '16 at 14:36
  • 2
    Sorry, I'm neither familiar with Go nor with gocl (I created jocl.org, that's why gocl.org jumped into my eye ;-)), just wanted to give a pointer. Some "general" words that I wrote in [this answer](http://stackoverflow.com/questions/22866901/using-java-with-nvidia-gpus-cuda/22868938#22868938) might nevertheless be relevant for you as well, regardless of the language and library that you are going to use... – Marco13 Feb 18 '16 at 15:25
  • 3
    It may be worth adding to the conversation that tensorflow has a golang API. – Bobby May 25 '17 at 13:44

0 Answers0