HowTo Include C ++ Class in the OpenCL Core

I am working with OpenCL 1.2 and am having problems with the OpenCL C ++ Wrapper API ( https://www.khronos.org/registry/OpenCL/specs/opencl-cplusplus-1.2.pdf ).

It does not indicate any restrictions on the inclusion of the class "MyClass class" in the kerenel (cl) file, and I believe that this is possible, since the platform, device and context are "classes" (if not, what is its objectivity then? X_X)

Well, I have the following simple class in the printer.h file :

class Printer{

    public:
        void print();
}

And in the cl file , I have the following lines:

#include "printer.h"
__kernel void hello()
{
    Printer myPrinter;
    //myPrinter.print();
}

cpp, : 'class'. Intel Opencl, SYCL, "" ?

+4
1

:

  • API OpenCL ++ Wrapper ++ OpenCL API. ++ . OpenCL 1.2, .
  • OpenCL 2.2 OpenCL ++ ( OpenCL 2.1).
  • SYCL - - ++ , , API- ++ . SYCL .
+7

Source: https://habr.com/ru/post/1692236/


All Articles