I\'m a novice in OpenCL.
I have an algorithm which uses templates. It worked well with OpenMP parallelization but now the amount of data has grown and the only way t
I have written an experimental C++ to OpenCL C source transformation tool. The tool compiles C++ source (even some STL) into LLVM byte-code, and uses a modified version of the LLVM 'C' back-end to disassemble the byte-code into OpenCL 'C'.
Please see http://dimitri-christodoulou.blogspot.com/2013/12/writing-opencl-kernels-in-c.html
For example, this code using C++11's std::enable_if can be converted into OpenCL 'C' and then executed on the GPU:
#include
template
T foo(T t, typename std::enable_if::value >::type* = 0)
{
return 1;
}
template
T foo(T t, typename std::enable_if::value >::type* = 0)
{
return 0;
}
extern "C" void _Kernel_enable_if_int_argument(int* arg0, int* out)
{
out[0] = foo(arg0[0]);
}