Is it possible to call a function pointer from OpenCL code?
Example:
__device int MyAddFunction ( const int a, const int b )
{
return a+b;
}
typedef void (*func) ( const int a, const int b );
__kernel void main ( global int *a, global int*b, global int *out )
{
func myFunc = MyAddFunction;
const int idx = get_global_id(0);
out[idx] = myFunc(a[idx],b[idx]);
}
???
thx