Why Optimizing Kernel Code Is Important?
An issued kernel is called many times by the OpenCL™ run-time. Therefore optimizing the kernel can bring a substantional benefit. If you move something out of the innermost loop in a typical native code, move it from the kernel as well. For example:
- Edge detection
- Constant branches
- Variable initialization
- Variable casts