Apple uses some Imagination

19 December 2008

It's tough to disagree with Rik Myslewski at The Register's take on Apple's decision to buy around eight million shares in Imagination Technologies. Although Apple is already using Imagination's PowerVR through the Samsung applications processor in the iPhone-class devices, all the signs point to Apple wanting to shift more of the software burden to graphics processors in not just its desktop products but the mobile ones as well. This is why the Snow Leopard release of Mac OS X is likely to be more important in the future than the laundry list of features that characterised its predecessor, Leopard, as I wrote in The Guardian yesterday.

For anything that can make use of large quantities of parallelism, graphics processors (GPUs) are more energy efficient than general-purpose processors. In fact, they are so good that we may well see a subtle rebranding of these devices, underlining the idea that do not have to be used just for graphics. The term "stream processor" is turning up more often. Take nVidia, which makes the GPUs used in the latest generation of MacBook machines. The company refers to the processors inside the chips as stream processors, a nod to Prof Bill Dally of Stanford University who has come up with a number of key concepts for doing efficient parallel processing and is working on some ideas for improving their energy efficiency.

OpenCL, the programming interface that will appear in Snow Leopard and wind up being ported to Windows and other operating systems through the efforts of ATI, nVidia and others, does not depend on a GPU being present. The standard can use more or less any processor. It just happens that GPUs have the features needed, can offer the performance wanted and already ship in a lot of machines. One of the most important parts of OpenCL is how it deals with memory.

Dally's research has demonstrated how continually fetching data from memory chews up more power than actually doing the calculations. General-purpose processors then make it even worse by trying to keep caches in sync between themselves and main memory. This causes a massive increase in traffic between all the memory controllers and, with it, power. OpenCL, and the proprietary graphics languages such as nVidia's CUDA, side-step the problem by getting the compiler to work out where data needs to be, rather than relying on power-hungry hardware, and keeping it there until it can be moved out of the way.

It's tough to make all software fit into a framework like that of OpenCL. But there is no need. You can get the difficult software to run on a standard Intel or ARM core and then devolve the stuff that can benefit from parallel processing and which can fit the demands of OpenCL to a specialist processor. As long as you know something that supports OpenCL – at minimum it could be a general-purpose processor – you know that the software will run. And it should not make a difference whether it is a desktop, laptop or mobile phone.

There will be some differences between the desktop and phone environments as the mobile version of OpenCL is a subset of the main standard. But programmers will be able to write applications that target both.

For Apple, there is a distinct advantage in promoting OpenCL. Even more of the software winds up not being dependent on what the host processor is. You can compile the OpenCL on the fly – this makes it possible to ship one version of the code and have it work on any machine. Were Apple to couple that with some kind of managed-code environment, it no longer has to worry whether applications run on the Intel-based Macs or the ARM-based iPhones, or whatever appears in between.

If Apple regards its investment in Imagination as strategic, then it tends to swing the company's future focus more in favour of using ARM for mobile products based on the iPhone cut of OS X, rather than the Intel Atom, where you might expect a greater concentration on compatibility with the Mac. I'm hearing more and more that any Mac netbook, should it ever appear, is more likely to use something from the ARM Cortex-A family than an Atom. It gives Apple more control over the platform and what can run on it and also will have better power-consumption specs. ARM will not be too happy that its Mali has been passed over for the PowerVR, although Imagination has a much longer track record here, but ARM's management has the still unconfirmed multi-year architectural licence deal with Apple to comfort it.

Perhaps Apple's dumping of (and on) Macworld is itself a signal to what the company is up to. It's not about the Mac anymore, it's about the virtual machine that goes under the name OS X.