I'm pretty new to OpenCL. My OpenCL-code is pretty simple. It contains 2 functions where the __kernel-functions calls another (non-kernel) function. I want pass the array to this function, but when I do that, my function (add) always returns 0. The complete array is 0. But when I access the same index in my kernel-function, the result is as expected... here's the code I'm using:
int add(__global int * numArray) {
return numArray[1]+numArray[2];
}
__kernel void sum(__global int * numArray, __global int * result) {
result[get_global_id(0)] = numArray[0] //
result[get_global_id(0)] = add(numArray); // = 0
}
Is there anything I doing wrong here?