Is it possible to write OpenCL kernels in C ++ rather than C?

I understand that there is an openCL C ++ API, but I had problems compiling my kernels ... do I need the kernels to be written in C? And then this is just host code that could be written in C ++? Or is there a way to write kernels in C ++ that I cannot find? In particular, I am trying to compile my kernels using pyopencl, and it seems to fail because it compiles them as C code.

+5
source share
3 answers

OpenCL Cis a subset C99.

There is also OpenCL C++(OpenCL 2.1 and OpenCL 2.2 specs), which is a subset C++14, but it has not yet been implemented by any of the vendors (OpenCL 2.1 is partially implemented by Intel, but not by C ++ kernels).

Host code can be written in C, C ++, python, etc.

In short, you can read about OpenCL on wikipedia . There is a description of each version of OpenCL. As pyopenclyou can use OpenCL1.2 (as far as I know, not yet support OpenCL2.0). Learn more about OpenCL on the Khronos website .

+9
source

, Boost.Compute. pyopencl, , pyopencl, , OpenCL ++.

SO ( Boost.Compute) , OpenCL .

+1

SYCL ComputeCpp https://www.codeplay.com/. IWOCL.org, C++ . SYCL OpenCL " ". https://en.wikipedia.org/wiki/SYCL. SYCL: " SYCL OpenCL CUDA Nvidia". ( ) SYCL OpenCL.

+1

All Articles