pass pointer arguments to non-kernel function in deivice

I try to build a simple OpenCL program for a lesson I have. I’ve done a little search but I haven’t figured out yet how to procceed. So my problem is this:

I want to have 2 functions in the device, one kernel that calls the other one that is not kernel. The thing is I want to pass pointer arguments, but I read that this is not possible.

__kernel void kernel_func(__global double *startpt, __global double *endpt) {
   //something with startpt

double normal_func(double *endpt){
   for(i = 0; i < 8; i++) endpt[i] = 1;

Also, I would prefer to have endpt as private to each thread and in the end of kernel_func perform a reduction by minimum to some of the values of endpt and return to device the endpt of one thread.
Any help would be appreciated. Even links.

Really? Where did you read such nonsense?

You should check the compiler error on this code, it should point you in the right direction. The types are just wrong, you need to include the address space qualifiers (global/local/etc) as well.

My mistake. I found the solution. I couldn’t understand why i can’t pass a __global pointer to a non __global. Now i do :smiley:

Thanks for the help, Mr. notzed

I am also stuck on this. Could you please post the solution that you found?

Sorry I forgot to check the thread twice. Are you still interested in an answer or you saw through your problem?