PDA

View Full Version : User defined functions in OpenCL code



Rui
05-27-2010, 01:27 PM
Is it possible to create our own functions in OpenCL code, so that the kernels could call them? Where can I see some simple example of doing this?

dominik
05-27-2010, 03:32 PM
Is it possible to create our own functions in OpenCL code, so that the kernels could call them? Where can I see some simple example of doing this?
Yes, you can simply define functions in your .cl file. They look just like kernel functions, but without the __kernel keyword. You can probably find examples in the NVidia or ATI Stream SDK.