Neon is a high-level domain-specific programming language for writing efficient image processing programs which can run on either the CPU or the GPU. End users write Neon programs in a C# programming environment. When the Neon program is executed, our optimizing code generator outputs human-readable source files for either the CPU or GPU. These source files are then added to the user source tree, compiled and executed. When targeting CPUs, the Neon compiler automatically generates highly optimized, multithreaded, vectorized code for processors supporting the SSE instruction set. For GPU applications, the compiler generates HLSL pixel shaders and the required Direct3D 10 setup code to sequence shader passes. In both cases, the performance of Neon programs rivals that of other widely used general purpose image processing sys
tems such as Apple Core Image and Adobe Pixel Bender. In particular, the performance of Neon programs running on the CPU is closer to GPU performance than might be expected from the peak floating-point performance of each architecture.