Considering native_ Versions of Math Built-Ins

OpenCL* offers two basic ways to trade precision for speed:

For the list of other compiler options and their description please refer to the User’s Guide (see Related Documents). In general, while the -cl-fast-relaxed-math flag is a quick way to get potentially large performance gains for kernels with many math operations, it does not permit fine numeric accuracy control. Consider experimenting with native_* equivalents separately for each specific case, keeping track of the resulting accuracy.

Native_ versions of math built-ins are generally supported in hardware and run substantially faster, while offering lower accuracy. Use native trigonometry and transcendental functions, such as sin/cos/exp/log, when performance is more important than precision.

The list of functions that have optimized versions support is provided in "Working with cl-fast-relaxed-math Flag" section of the User’s Guide (see Related Documents).

See Also


Why Optimizing Kernel Code Is Important? (suggested next topic)
Related Documents
The OpenCL* 1.1 Specification at http://www.khronos.org portal [PDF]
Overview Presentations of the OpenCL* Standard at http://www.khronos.org portal [Online Article]
Optimization Notice

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804


Submit feedback on this help topic

Copyright © 2010-2012, Intel Corporation. All rights reserved.