Skip to main content

Alternatives to C++ Function Pointers in SYCL using Function Objects

In C++, especially in modern C++, function pointers are a legacy feature from the C language but they still exist in some code bases. SYCL does not provide support for function pointers as this is a limitation posed by the design of OpenCL v1.2 which is the basis of the current SYCL v1.2.1 definition. The good news is that we can use modern C++ to implement a solution that can be used with SYCL. Learn how to do this with examples from Codeplay.