By Arch Robison
Are you a C or C++ programmer who has ever envied APL or Fortran 90’s array expressions? Read on. If you don’t know what array expressions are, then you really should read on, to find out what you should have envied. In any case, the envy is over, because Intel Parallel Composer 2011 brings array expressions to C and C++.
A while back I wrote about the Three Layer Cake pattern for parallel programming. The pattern is a way of organizing programs to fully exploit modern multi-core chips. Two of the layers are:
* fork-join: harnesses multiple hardware threads.
* SIMD: harnesses SIMD instructions.
The compiler in Intel Parallel Composer 2011 extends C++ to directly support these two layers. The extensions are called Intel(R) Cilk Plus. They are:
* Cilk notation for specifying fork-join parallelism.
* Array notation for specifying SIMD parallelism.
This blog introduces the array notation, with a Seismic Duck kernel as the example. I’ll introduce Cilk notation in another blog. The two notations are independent. Indeed, the array notation is valuable with other threading packages too, such as Threading Building Blocks, or just for writing faster serial code.