A solution to generate code for CUDA and OpenCL with C++:
by Denis Demidov
From the talk description:
VexCL is an opensource C++ vector expression template library for OpenCL/CUDA. It has been created for ease of GPGPU development with C++ and provides convenient and intuitive notation for linear algebra operations, vector arithmetic and various parallel primitives.