recreate clCreateKernel

i don’t know how to recreate the clCreateKernel()?i want to Processing video?but they cost so much time to create kernel program?please help me~~~~~~~

You don’t need to call clCreateKernel() very often. You can reuse the same kernel all the time and instead call clSetKernelArg() multiple times when you want to change the kernel arguments.

can you give me a sample?
because i try to reuse the kernel,but the program have error,thank!

Don’t really understand that :([/quote]

This is a very basic library calling technique, seen in pretty much any computer language in existence.

Think of the kernel as an object, clSetKernelArg just sets state on the object, and clEnqueueNDRangeKernel uses it’s current state to invoke a remote procedure. The object is then free to be changed and re-used as required.

If you don’t understand this you are going to have real trouble using opencl as this is pretty much the simplest part of the whole system.