O'Reilly logo

OpenCL Parallel Programming Development Cookbook by Raymond Tay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring your OpenCL projects to enable the double data type

Today's modern processors from Intel, AMD, and ARM have their floating-point units (FPUs) IEEE 754 compliant; however, ARM has both hardware and software support for half-precision numbers in addition to single-precision and double-precision numbers. Hence this implies that your OpenCL programs can actually utilize half-precision on ARM-based processors and this raise a question on how can one determine what sort of floating-point support does the device have.

The answer to that question is to query the device via the clGetDeviceInfo API and passing in any of the following parameters: CL_DEVICE_SINGLE_FP_CONFIG, CL_DEVICE_DOUBLE_FP_CONFIG, and CL_DEVICE_HALF_FP_CONFIG which identifies ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required