How do i define functions in OpenCL? I tried to build one program for each function. And it didn't worked.
float AddVectors(float a, float b)
{
return a + b;
}
kernel void VectorAdd(
global read_only float* a,
global read_only float* b,
global write_only float* c )
{
int index = get_global_id(0);
//c[index] = a[index] + b[index];
c[index] = AddVectors(a[index], b[index]);
}