Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

C++ 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)

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.