Altera_Forum
Honored Contributor
12 years agoC++ support for AOCL
Does the OpenCL SDK support C++?
If so, what are the limitations? The prorgramming guide isn't quite clear on C++ support (at least, from a quick glance-through)Does the OpenCL SDK support C++?
If so, what are the limitations? The prorgramming guide isn't quite clear on C++ support (at least, from a quick glance-through)At the moment there are no C++ wrappers available in the Altera OpenCL SDK. When vendors add support for C++ it's only for the host side, and as far as I know it's typically just in the form of a wrapper that sits in between your host code and the underlining runtime implemented in C.
This.
--- Quote Start --- as far as I know it's typically just in the form of a wrapper that sits in between your host code and the underlining runtime implemented in C. --- Quote End --- Just save cl.hpp (http://www.khronos.org/registry/cl/api/1.2/cl.hpp) in $ALTERAOCLSDKROOT/host/include/CL and voilà. You then include cl.hpp instead and make use of all the C++ goodness. I can't see why Altera doesn't ship this header as part of its SDK. I've been using it since the beginning and I never had any problems.If you want to use cl.hpp as mentioned above, make sure it's the header supporting the OpenCL spec 1.0 and 1.1: http://www.khronos.org/registry/cl/api/1.1/cl.hpp.