5 Replies Latest reply on Jun 28, 2012 9:08 AM by LeeHowes

    C++ wrapper API and APP 2.7 new features


      Hi to everybody.

      By now I'm programming OpenCL using plain C API but I'm planning to move to C++.

      I'd like to know if using C++ API is needed to enable the new features of AMD APP 2.7, like OpenCL 1.2 support, or if these features are enabled also if I continue programming in plain C.
      Moreover, I'm not able to find the specification of the AMD C++ wrapper (in particular, the list of classes/functions). Do I have to use the khronos one? If I'm not wrong, AMD extended this API, so I should rely on a different specification. Can you point me to it, if exists?


      Thank you very much!

        • Re: C++ wrapper API and APP 2.7 new features

          The version of the C++ wrapper in the 2.7 SDK is slightly ahead of the Khronos ratification, which is a benefit AMD being the maintainers of the header. There is a version with Khronos for review at the moment, which will be slightly updated from the 2.7 version and better documented, and we hope that will be public soon.


          1.2 support is fully enabled in the C API. The C++ wrapper is designed to be a very thin, essentially overhead-free, wrapper around that. You *may* see some minor changes when we update to the official khronos version with 1.2 features but they should be minor. I would certainly recommend you switch to the C++ wrapper - the benefit of RAII state management alone is enormous.


          As for a specification that is simply a little out of date. We do need to update it to match the features in the header it's just that features had to be implemented and tested before a specification could be written, and everyone both in AMD and Khronos is pretty busy at the moment.

            • Re: C++ wrapper API and APP 2.7 new features

              Thank you for your answer.
              Giving a look to AMD APP samples, it seems that most of them are still developed in plain C (i.e. clCreateBuffer instead of cl::Buffer). Do you plan to switch to C++ API for feature samples?

              • Re: C++ wrapper API and APP 2.7 new features

                Do I take it correctly that AMD is maintaining the C++ wrapper headers?


                I would also like to stand in line for a more thorough documentation of the C++ headers. To be precise, the reason I cannot advise anyone to start learning OpenCL alone using the C++ wrapper is because:


                • There are far less tutorials available on the internet that are using the C++ API instead of the standard C.
                • The documentation only points out the differences, compared to the underlying C API, so practically one's gotta know the C API inside and out.


                I know it's a real pain, since the C specs are let alone 377 pages, but something similar for the C++ headers would be nice too, to have everything one's gotta know in one place. If everyone is very busy, this most certanly will not happen, but I would definately make it a long term goal.


                And I'm also waiting for an updated header: http://www.khronos.org/message_boards/viewtopic.php?f=28&t=5114&sid=eb00f7f2e001695f382d5121bd62004d

                I happened to ask this roughly a week ago on Khronos forum, but noone answered.

                  • Re: C++ wrapper API and APP 2.7 new features

                    With input form other Khronos members, yes. Laurent Morichetti and Ben Gaster of AMD wrote it originally (as noted in the header) and I've been making the 1.2 updates.


                    More thorough documentation has been under discussion. We've realised the need for that. At the very least I, with some very useful input from a collaborator, have been working on adding doxygen comments to the header so that it's a bit better documented as a standalone file. Expect updates soon, it's just in a bit of a backlog since our TODO lists piled up.