Several kernel in one program

Hello,

I have some problem while writting two kernels A and B in only one program. I mean that when there is only the kernel A in my .cl file, everything is fine, but if I put the two kernels in my .cl file, none of them can run correctly. It seems that all the arguments of kernel A are NULL… More precisely, I declare my parameters argument to be in constant memory (as the buffer is declared with CL_MEM_READ_ONLY), but reading __constant Param give me initialized data; but if I prefix the param by __global, it’s ok …

If I write my kernels in separated files, the two run perfectly… Is there a known issue with writting several kernels in the same file ?

I also experience some trouble with the global/constant memory space: how can I clearly specify where my argument data will be ? Is it enough to specify the buffers that will contain my data as CL_MEM_READ_ONLY to put data in __constant memory ?

Thank you for help !

PS: I run OpenCL 1.0 on a GeForce 285

I think we are going to need some code to better understand your problem. One of my programs runs 3 kernels with out problems, one of which also has a sub-function. We need to know just how you are defining and calling your kernels, then we can help you better. :)

I think we are going to need some code to better understand your problem. One of my programs runs 3 kernels with out problems, one of which also has a sub-function. We need to know just how you are defining and calling your kernels, then we can help you better. :)

There is a thread discussion constant memory issues at http://forums.nvidia.com/index.php?showtopic=178895. Sounds like you have the same problem.

There is a thread discussion constant memory issues at http://forums.nvidia.com/index.php?showtopic=178895. Sounds like you have the same problem.