calling kernel from another kernel

Hi,
could I call & execute a kernel function from another kernel function?
my GPU code does some computation on some input data and in the middle of the computations, it needs to compare the input with an array of about 1000 values sequentially! so this of course is not efficient and increases the running time… so I thought of extracting the search code alone and letting it be executed in parallel too… is this feasible?

could I call & execute a kernel function from another kernel function?

Yes, that is legal. However, this has the same semantics as calling any other function. In other words, it will not spawn new work-items.

There is no way to generate new work-items from a running kernel.

it needs to compare the input with an array of about 1000 values sequentially!

Is this something you could improve with a better data structure such as a hash table or a search tree? What about applying a reduction? (To find the max/min/etc).