FAQ
Hello Gophers,

I was wondering if we could program GPU code in Go.
Today, packages define CPU code. We could have a
way to define GPU packages. They could be .go files
starting with "gpupackage <ident>". Then the GPU code
could be called from the CPU code with something like:

go<<<x,y>>> functionname(...)

Just sharing thoughts ...


--
Luis Otavio de Colla Furquim

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Lars Seipel at Nov 21, 2014 at 5:12 pm

    On Fri, Nov 21, 2014 at 02:53:47PM -0200, Luis Furquim wrote:
    I was wondering if we could program GPU code in Go.
    GPUs suck at executing general purpose code. Even if you succeed at
    writing Go in a style suitable for GPUs you'd still lack a compiler. I
    might not be up to date on these issues but I don't think the
    architecture of common GPUs is documented in a form that is anything
    like what's available for CPUs.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Luis Furquim at Nov 21, 2014 at 5:36 pm
    Hello Lars,

    I was not wondering about running general purpose code
    at GPUs. I was wondering to write the GPU code in Go.


    Extending the example, we could have a program with
    2 packages:

    gpupackage vector

    func Add(a, b, c []float64) {
         for i:=0; i<len(a); i++ {
             a[i] = b[i] + c[i]
         }
    }


    package main

    import (
         "fmt"
         "./vector"
    )

    func main() {
        var a, b, c []float64
        // some initialization code where b and c are filled with data
        go<<<32,100>>> vector.Add(a,b,c)
        // some sync code
         for i:=0; i<len(a); i++ {
             fmt.Printf("%d: %f\n",i,a)
         }
    }


    The package main would be compiled to CPU code and
    the package vector to GPU code.


    Best regards
    Luis Furquim


    On Fri, Nov 21, 2014 at 3:12 PM, Lars Seipel wrote:
    On Fri, Nov 21, 2014 at 02:53:47PM -0200, Luis Furquim wrote:
    I was wondering if we could program GPU code in Go.
    GPUs suck at executing general purpose code. Even if you succeed at
    writing Go in a style suitable for GPUs you'd still lack a compiler. I
    might not be up to date on these issues but I don't think the
    architecture of common GPUs is documented in a form that is anything
    like what's available for CPUs.


    --
    Luis Otavio de Colla Furquim

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 21, '14 at 4:54p
activeNov 21, '14 at 5:36p
posts3
users2
websitegolang.org

2 users in discussion

Luis Furquim: 2 posts Lars Seipel: 1 post

People

Translate

site design / logo © 2021 Grokbase