cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jm7788
Journeyman III

OPENCL CPU number of kernel arguments

hi,

i'm trying to bring alot of (~50) arguments by my OpenCL AMD APP into kernel

and it looks like this:

kernel void test(int ip,

                         int ix,

                         int iy,

                         global float *mm,

                         global float *nn,

                         global float *oo,

                         int nx,

                         int ny,

                         global int *p,

                         global float *fa1,

                         global float *fa2,

                         global float *fa3) { ...}

I started with an empty kernel, and inserted one argument after another into argument list in cl-file.

Everything works without any trouble, until adding the the last one, "fa3".

But no buildlog messages while building program.

But since that last adding, i got segmentation faults at runtime, .

Q: So, is there any limit in the general number of arguments?

What have i overlooked? These are no constant, where i have e.g. a limit of 8.

Thanks!!

PS: i found an example of my own, where i added 13 arguments, but only 2 were global float*, one as input, the other as output

So it may have something to do with the cl_mem variables that i have defined outside (float *) kernel (and should get them as global float* inside)

0 Likes
2 Replies
nou
Exemplar

yes there is limit look at CL_DEVICE_MAX_PARAMETER_SIZE from OpenCL specification.

0 Likes

Nou, You are a great friend..... Thanks!

So, here is a bit more info from the spec..

You can get this from "clGetDeviceInfo" call....

CL_DEVICE_MAX_PARAMETER_SIZE - Max size in bytes of the arguments that can be passed to a kernel.
The minimum value is 1024. For this minimum value, only a maximum of 128 arguments can be passed to a kernel.

But all these said, the program should not segmentation fault.

Can you provide us the code that was seg-faulting? (assuming there are no bugs from your side 🙂 )

- Bruhaspati

0 Likes