Dr. Dobb's Digest February 2009
Wouldn't you know it. Just as we're starting to wrap our minds around the idea of parallel programming and multicore processors, Intel ups the ante with Larrabee, a many-core architecture that has the potential to change the game. This doesn't mean that the concepts of multithreading and parallel programming can be ignored. Quite the contrary. If anything, thinking parallel and having a firm grasp on multithreading will be more critical than ever -- especially if you intend on tackling Larrabee.
So what is Larrabee? First of all, Larrabee is an architecture designed around cores (and lots of them, each x86 and each with its own cache), threads (even more of them), and an instruction set. What sets Larrabee apart from other multicore CPUs, however, is that its architecture can and will lead to hybrid processors that combine the functions of general-purpose processors (CPUs) and graphics processes (GPUs) -- GPGPUs, in other words. But let's go back to the instruction set because that's what makes things really interesting for developers.
Referred to as ÒLRBniÓ (short for ÒLarrabee New InstructionsÓ), the instruction set is based on an extended version of the x86 instruction set. Those extensions include a vector programming extension that, as it turns out, is quite useful for graphics processing. Collectively, what the extensions bring to the table are more flexibility for developers and higher performance for the applications they create.
The Larrabee native programming model resembles the now-familiar programming model for x86 multicore architectures, starting with threading that's based on the POSIX Threads API (P-threads). However, Intel has extended the API so that developers can specify thread affinity with a particular hardware thread or core. Acknowledging that in some applications thread creation/switching might be too expensive, Larrabee supports a task scheduling API, like that included in Intel's Thread Building Blocks C++ Library. Additional thread programming support is delivered via OpenMP pragmas in the C++ compiler, which also includes a Larrabee version of Intel's autovectorization compiler technology. Developers who need to program Larrabee vector units directly can do so with C++ vector intrinsics or inline Larrabee assembly code.
From all this, you've likely assumed that you can use current generation C++ toolsets to build Larrabee-based applications -- and for the most part, you'd be correct. Most existing C/C++ applications can be recompiled and execute correctly for Larrabee. The exceptions involve (unsurprisingly) system calls and drivers.
What can we expect in terms of Larrabee-based applications? Certainly games will be high on the list. Intel is planning a major Larrabee splash at next month's Game Developer Conference in San Francisco, where former Dr. Dobb's columnist Michael Abrash (among others) will lift the lid on LRBni. Other applications include video processing, the likes of which were highlighted by Intel and DreamWorks Animation in a SuperBowl commercial earlier this month. In the longer term, however, Intel sees visualization and the emergence of visual computing as key to Larrabee's success. In this visual world, communication via images will impact every thing from business analytics to engineering and high-performance computing. But all this takes horsepower -- the kind of horsepower Larrabee brings to the table.
So just a gamer, or is Larrabee truly a game changer? Initial Larrabee-based products will likely be released as discrete GPU devices and ship with four cores; although over time you can expect dozens, if not hundreds, of x86 machines running on a single processor. This means that developers can treat Larrabee as a CPU/GPU combo integrated into a single processor that delivers GPU performance while still supporting a full range of non-graphics software. Larrabee will also support a more diverse parallel programming environment. Want to use OpenCL instead of OpenMP? No problem. Or do you want to use MPI or Threaded Building Blocks instead of OpenCL? It's up to you. That kind of flexibility can make Larrabee a game changer too.