how to write opencl kernels

Hi, everyone
I looked through the OpenCL Specification, but did not find the method how to write kernel functions. so, where can i find the document? thanks!

Tutorials for OpenCL should be easy to find. I assume that the most common implementations (NVIDIA, Apple and AMD) all pass introductory type documents with their SDKs.

thank you for your answer, but i have another question, from your answer, I conclude that i must write different kernel functions towards different graphic cards? thanks.

No. The whole point of OpenCL is that is is platform independent. You write your program and kernels once, and then the OpenCL runtime translates the OpenCL kernel code to some platform-specific format that is sent to the OpenCL device.

Have, for example, a look at