How AMD Is Taking Standard C/C++ Code To Run Directly On GPUs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • schmidtbag
    Senior Member
    • Dec 2010
    • 6618

    #11
    Kinda makes me wonder why this wasn't done nearly 20 years ago? Even though there are many good reasons for the CPU to do the work, having the option for the GPU to do "raw" C code would still make sense and perhaps would have seen CUDA with a lot less adoption.

    Comment

    • Nille
      Senior Member
      • Jul 2008
      • 1305

      #12
      Probably because you need a certain feature set to run a program independent from all else on the gpu.

      Comment

      • carewolf
        Senior Member
        • Nov 2012
        • 2272

        #13
        Originally posted by habilain View Post

        GPUs are turing complete these days, so "slow" rather than "not possible". I think at the moment it's mainly "this code can be run on the GPU" rather than automatic offloading - which, while it would be nice for the lazy programmer, would probably not be possible on a standard GPU architecture. That's mainly because the GPU and CPU do not share the same memory, so offloading a loop from CPU to GPU has a high fixed cost and I really don't see a good way of being able to automatically determine when it's worth doing.
        Using the GPU integrated into the CPU that use the same memory?


        Comment

        • Guest

          #14
          Originally posted by ddriver View Post
          Bad idea,
          why do you make a negative assessment of what many are waiting for with great joy? For many, this is a step into the new. You can stay, no one is calling you to go ahead. we are tired of CPUs, with their inability to run simultaneous code execution. Now, when Google announced the possibility of releasing quantum processors, in 2024, thanks to people like you, we still cannot use the GPU to run user functions on them.

          Comment

          • sophisticles
            Senior Member
            • Dec 2015
            • 2619

            #15
            This is a great idea, here's what I would like to see happen:

            They create a simple, Python style language, that has easy to learn and read syntax and is easily expandable via libraries.

            Then add a function decorator that allows a programmer to specify which parts of the code should be run where, for instance:

            @_CPU
            def function(ONE)

            @_GPU
            def function(TWO)


            @_CPU​_128_SIMD
            def function(Three)

            I guess what I am saying is write a compiler for Python that allows a programmer to specify on what hardware he wants that code portion to be executed.
            Last edited by sophisticles; 11 December 2024, 03:02 PM.

            Comment

            • Limit
              Junior Member
              • May 2015
              • 8

              #16
              Originally posted by sophisticles View Post
              I guess what I am saying is write a compiler for Python that allows a programmer to specify on what hardware he wants that code portion to be executed.
              Your description sounds like what Mojo is trying to achieve.

              Comment

              • ojsl1
                Junior Member
                • Sep 2023
                • 43

                #17
                Originally posted by schmidtbag View Post
                Kinda makes me wonder why this wasn't done nearly 20 years ago? Even though there are many good reasons for the CPU to do the work, having the option for the GPU to do "raw" C code would still make sense and perhaps would have seen CUDA with a lot less adoption.
                Twenty years ago AMD wasnt there pushing for open-source, that's why. Stereotypical corpo thinks keeping their hardware inaccessible makes it look more magical than it actually is.

                Comment

                • habilain
                  Junior Member
                  • Feb 2016
                  • 39

                  #18
                  Originally posted by carewolf View Post
                  Using the GPU integrated into the CPU that use the same memory?
                  Probably not possible? ROCm doesn't officially support APUs, so I'm pretty sure ROCm doesn't support zero copy. Or if it does, that's weird.

                  Even if it is possible, I'm not sure there'd be that much benefit. APUs aren't that powerful - and it would likely still need special code to get decent performance. For example, double precision floating points tend to be quite slow on a GPU.

                  Comment

                  • marlock
                    Senior Member
                    • Nov 2018
                    • 435

                    #19
                    is AMD finally thinkering and trying to use their iGPUs instead of CPU wide vector extensions like AVX-whatever-size-is-biggest-now?

                    Comment

                    • lem79
                      Senior Member
                      • May 2008
                      • 230

                      #20
                      Originally posted by habilain View Post

                      Probably not possible? ROCm doesn't officially support APUs, so I'm pretty sure ROCm doesn't support zero copy. Or if it does, that's weird.

                      Even if it is possible, I'm not sure there'd be that much benefit. APUs aren't that powerful - and it would likely still need special code to get decent performance. For example, double precision floating points tend to be quite slow on a GPU.
                      Maybe not weird if there has been work already to support Strix Halo (we could hope that's the case).

                      Comment

                      Working...
                      X