How do you evaluate fuctions like sqrt() in a __kernel function? I did a straightforward implementation but that does not work. Like:
is anything extra required?Code :
__kernel void Calc(int *a, int *b){ b[0] = sqrt(a[0]); }
Printable View
How do you evaluate fuctions like sqrt() in a __kernel function? I did a straightforward implementation but that does not work. Like:
is anything extra required?Code :
__kernel void Calc(int *a, int *b){ b[0] = sqrt(a[0]); }
What is the problem?
You want to test opencl sqrt function, or use native kernel and test the C sqrt function?
The OpenCL spec lists all the math functions that are included. You can find this on the Khronos site. To use them you simply call them with the appropriate arguments. There is no need to include/use math.h as these are built-in.