Real World Tech dissects OpenCL

By now, you’re surely heard of OpenCL, the cross-platform API designed to allow software developers to tap the processing horsepower of GPUs for computational tasks. But what do you actually know about the API? Probably not nearly as much as Real World Tech’s David Kanter, who has put together an excellent article on the subject.

Kanter describes OpenCL’s origins at Apple and reveals that, due to early cooperation with Nvidia, the API was influenced heavily by CUDA. Apple then went on to collaborate with Intel, AMD, and Imagination Technologies before handing off the API to the same group responsible for governing the OpenGL graphics standard. OpenCL isn’t just for GPUs, though. As Kanter points out, the API aims to take advantage of “heterogeneous computing resources for parallel applications.” Those resources include multi-core CPUs, Fusion-infused APUs, and even chips like the Cell processor inside the PlayStation 3.

As usual, Kanter’s analysis delves into technical details like OpenCL’s execution and memory models, and he compares both to DirectCompute, Microsoft’s Windows alternative. He goes on to predict that, as we’ve seen with DirectX and OpenGL in the graphics world, DirectCompute and OpenCL will become the dominant standards. If history is really is a good indication, though, DirectCompute could prove to be far more popular for mainstream apps than its cross-platform rival.

Comments closed
    • dkanter
    • 9 years ago

    Smileman – To some extent it’s true that my article was not 100% novel (or even 50%). However, I think there are several points you are missing:

    1. It’s more detailed than most (although less detailed than the spec itself)
    2. It’s also very clear about the correspondence between CUDA, DXC and OCL.
    3. I actually discuss some of the disadvantages of OpenCL (e.g. explicit storage and forwards compatibility; aliasing due to pointers). That discussion is not common online.
    4. Discussion of correctness and performance on multiple platforms.

    So while I think it’s quite possible that skilled developers are fully aware of everything I wrote – most people are not. Frankly, one of the reasons I wrote that article is that I couldn’t find a good introduction (aside from Khronos group slides). It’s also a good bridge to more complex topics as well.

    David

    • moritzgedig
    • 9 years ago

    D. Kanter has said he is working on a follow up on the article, going into more architectural details.
    So the really interesting part is still to come.

    btw, this is not just for games, and no, this will not make windows, excel, word, browsing faster.

    • ronch
    • 9 years ago

    Not to burst anyone’s bubble, but they’ve been hyping these things for years. Multi-core computing? GPU computing? Sure, applications are available that can tap those dormant cores/stream processors, but not nearly enough to make everyone want a 6-core processor or a high end GPU to do all their tasks and really make a huge difference. I’d LOVE to see the day when I can really use my GPU to do everyday tasks, but right now it seems our best hope for that would be either Sandy Bridge or Bulldozer. Just leave GPUs to do what they do best, which is push pixels.

      • Deanjo
      • 9 years ago

      As someone that utilizes GPGPU capabilites every day I say:

      “Bite your tongue!”

        • ronch
        • 9 years ago

        Good for you, my friend.

      • Voldenuit
      • 9 years ago

      I’m currently considering moving my RAW workflow from Lightroom to Capture One v6 because of OpenCL acceleration. Just waiting till my next upgrade (which should be soon).

      • Veerappan
      • 9 years ago

      Well, I’m working on one project with everyday implications:

      I’m currently working on porting the VP8 video decoder to OpenCL. If all works out, when it’s complete you’ll be able to use your video card to accelerate the decoding of WebM video on Windows/Mac/Linux, AND if your GPU doesn’t support OpenCL, any available software implementations (e.g. AMD Stream, Apple’s CPU implementation) will be used as a multi-core decoder. If this works out as I hope, it’ll mean that something as slow as an Atom + Ion will be able to play back HD WebM video from Youtube without skipping frames.

      If that’s not an every day application, I’m not sure what is.

    • lycium
    • 9 years ago

    I’m working on Indigo Renderer’s OpenCL acceleration at the moment, and I much prefer its API to CUDA’s.

    Performance is unfortunately a lot more variable…

      • Deanjo
      • 9 years ago

      This is one of the downsides of openCL currently. Even though it is vendor agnostic and open you still have to do alot of vendor and device specific coding to get optimal performance with it.

        • WaltC
        • 9 years ago

        Thus it ever is with cross-platform initiatives…and what inevitably happens is that proprietary software, or at least highly platform-optimized software, is created on the dominant hardware platform to address the weaknesses in the cross-platform standard–and the cross-platform software is completely displaced on the dominant platform because of performance and efficiency reasons. It doesn’t mean that OpenCL won’t be used, just that it will probably find stiff competition in the dominant platform markets.

    • dragmor
    • 9 years ago

    The future of -[

      • Ushio01
      • 9 years ago

      No ARM and Atom will still be slower than an Athlon64

        • dragmor
        • 9 years ago

        A dual core 1.66ghz Atom (4 threads) feel faster and responds better than my single core 2.2ghz A64 (both running WinXP).

        Stick it on tablets with an OS made for the device and the user will get a much better experience from one of those than a 5 year old PC.

          • BlackStar
          • 9 years ago

          Lol.

    • geekl33tgamer
    • 9 years ago

    Do we really need this?

    Nvidia already have CUDA, AMD have Stream. Both are vendor locked depending on the end users choice of GPU, hence the limited use for either API, but…

    …DirectCompute is not taking hardware sides (ok, so you must have Windows). Microsoft will make sure this wins out over OpenCL, and will have the pockets of cash for marketing the tech too.

    I’ve not seen an OpenGL game on Windows for years now, and I can’t see a 4th CUDA wannabe surviving in the real world.

      • wibeasley
      • 9 years ago

      It’s gotta become more popular than Stream. I’m less optimistic (but wishful) that it will be more popular than DirectCompute.

      • flip-mode
      • 9 years ago

      What do you mean by “need”?

      • l33t-g4m3r
      • 9 years ago

      Are you serious? OpenCL is what will start moving adoption forward, since it isn’t proprietary. Not to mention linux, which directcompute doesn’t support.

        • Pettytheft
        • 9 years ago

        Being open doesn’t mean things get moved forward. If Microsoft is motivated to push direct compute they can and will get things done alot quicker than a committee ever could.

          • indeego
          • 9 years ago

          Microsoft no longer controls computing’s future landscape. They can not go full /[

          • TO11MTM
          • 9 years ago

          Not to overuse the term, but…
          “THIS”
          The reason Direct3D succeded over OpenGL wasn’t JUST the fact Card Manufacturers had better D3D than OGL support. It was the very important fact that Direct3D wasn’t afraid to add new features.

          Remember, Direct3d went in only 4 or so iterations from a platform iD basically refused to support to one they were behind. This wasn’t by accident; Microsoft was willing to listen to the developers and add features and make it development friendly.

          OpenGL on the other hand, most stories I’ve seen about it in the past decade have to do with it being in some level of Committee Hell.

          Alas, Games are a huge market for 3D Graphics, and as a result Direct3D moved in on that space and caused a lot of OpenGL Development to Stagnate (For better OR worse.)

            • WaltC
            • 9 years ago

            Yes, the ARB committee of old was highly divisive and fractionated, with 3dfx fighting nVidia who was fighting ATi who was fighting John Carmack of ID, and all of the rest of the ARB committee members had their own proprietary directions they preferred to see the Windows OpenGL API take. As a result of installing and legalizing proprietary extensions inside the API, to keep 3dfx and nVidia and ATi happy, the API as a whole just never developed in any kind of universal sense.

            Microsoft rightly perceived a vacuum of leadership and direction in the OpenGL API for Windows, and stepped up to the plate with D3d. From that point on, as you say, Microsoft listened very well and has kept the D3d API out front ever since.

          • just brew it!
          • 9 years ago

          That still does not address the needs of the Mac, Linux, and embedded (other than embedded Windows) communities.

      • djgandy
      • 9 years ago

      Well Nvidia and ATI are insignificant in the highest parts volume market that is mobile.

      But of course nothing else in the world matters except GTX 580’s, Extreme Extreme super Extreme CPU’s and Failtality branded products.

        • WaltC
        • 9 years ago

        And here I was thinking that some people think all that is important in the world are mobile gpus…;)

        Really, I don’t understand this constant penchant to directly compare desktop computer markets and paradigms to mobile “devices” which, although some of these devices are capable of a limited amount of data processing, are simply not in the same computational league as the desktop computing market. Certainly there is no direct competition between these markets, and it shouldn’t be forgotten that for every high-end gpu AMD and nVidia sell they make as much profit as they do selling perhaps a dozen or more of their cheapest “mobile” gpus.

        I think a lot of the blurring of the lines among these concepts came about because of Apple apologists pining to explain why Apple is every year devoting an ever-smaller chunk of its business to selling Macs–this past year, Macs comprised a mere 30% of Apple’s total business pie, which is down from the 100% the Mac business used to represent of Apple’s business. So the apologists are spinning the notion that desktop computing is a bygone market which will be replaced by the “device” market, as this would justify Apple’s leaving the Mac market behind as a percentage of its business.

        While it is certainly true that Apple is phasing personal computers out of its business plans and moving very swiftly into the proprietary device markets, this doesn’t mean that the desktop market is simultaneously ceasing to be…;) No, it just means that Apple’s perpetually teeny-tiny share of the personal computing market (~3.6% worldwide last quarter) will become even more irrelevant to that market than it already is. By the time the last Mac rolls off the Apple truck, Apple will be a thriving, vibrant company having completely transitioned out of the personal computer market and wholly into the proprietary “device” market, there to stay.

      • ltcommander.data
      • 9 years ago

      I believe DirectCompute is more focused on graphics related tasks working through the existing DirectX framework and on GPUs. OpenCL is more general, being more appropriate for pure number crunching like financial analysis applications, and has the flexibility of write once and target not just GPUs but CPUs, Cell, FPGAs, and other dedicated hardware accelerators.

      OpenCL was also written to target mobile devices, which is going to be a growing area. On mobile devices OpenGL ES is the dominant API and not DirectX and that isn’t likely to change, so that will leave DirectCompute out.

      • just brew it!
      • 9 years ago

      See #12. IMO what will save OpenCL is the strong presence of Linux in the scientific computing market. DirectCompute is going to have very little leverage there, because there will be a lot of resistance to adopting Windows for scientific cluster computing.

      Granted, this may end up relegating OpenCL to a niche market. So depending on your definition of “real world”, we may actually be in agreement…

      • stmok
      • 9 years ago

      l[http://www.nvidia.com/object/cuda_opencl_new.html<]§ AMD's Stream supports OpenCL. => §[<http://developer.amd.com/gpu/atistreamsdk/pages/default.aspx<]§

    • SPOOFE
    • 9 years ago

    Maybe OpenCL will help me learn how to press the proper Reply button next time…

    • thesmileman
    • 9 years ago

    I hate to be such a buzz kill but this article is a repeat of almost every introduction to OpenCL out there in the last two years. I am big on OpenCL and CUDA but this article is just a rehashing of at least 10 papers on the subject.

      • Cuhulin
      • 9 years ago

      I don’t think you are being a buzz kill. It’s just that TR has a far wider market than persons big on OpenCL and CUDA. For those of us who have other areas of interest but keep on eye on what is happening outside our area of focus, this was a good article, I think.

    • flip-mode
    • 9 years ago

    q[

      • dpaus
      • 9 years ago

      Well, that was them this is now. In those days, gaming was either on a PC or on a console, one of which was effectively a PC. The future of gaming is mobile, and there is no dominant standard platform there.

        • flip-mode
        • 9 years ago

        q[

          • dpaus
          • 9 years ago

          I meant to say “the future /[

            • TheEmrys
            • 9 years ago

            I’m pretty sure the future growth of gaming that requries an API is going to be in next gen consoles. Phones and tablets just don’t have the necessary inputs for complex gaming.

            • SPOOFE
            • 9 years ago

            /[

            • Farting Bob
            • 9 years ago

            Console gaming is reaching maturity, it cant keep on growing forever. Mobile gaming, while being around a long time (gameboy etc) and being very popular (DS) is now seeing a shift to casual mini games for phones, tablets etc etc.
            Angry Birds sold only 7 million copies of the paid version (and an estimated 17m downloads overall) and it was first released december last year.
            Thats the future of gaming, as much as hardcore PC gamers disagree.

      • BobbinThreadbare
      • 9 years ago

      Yeah, but Windows is the dominant OS in almost every situation.

        • flip-mode
        • 9 years ago

        I thought Linux ruled HPC, where OpenCL could really be leveraged in a big way…. Not true?

          • cygnus1
          • 9 years ago

          You’re correct. Many of the big compute clusters and grid computing projects are based on linux. Having this API there will be nice. Being able to mix and match different vendors hardware because it’s all abstracted will be nice too.

            • nexxcat
            • 9 years ago

            To be fair, in the HPC space, you don’t care about “mixing and matching”. If you’re not benchmarking the hardware pieces using your application pieces, as optimized as you can get it for the eval purpose, you’re not doing it right.

            I’m in ultralow latency HVDMA (high-volume direct market access) space. Our clients are other large financial firms, who require require ultrafast access to the various markets. None of them use Windows except at the GUI level, and when I talk shop with them, some of them have started using GPUs to crunch quantitative data.

        • stmok
        • 9 years ago

        r[

Pin It on Pinterest

Share This