Support for double floating-point precision is a requirement for a class of scientific computing algorithms/applications. This class of applications can be enabled by adding support for double precision floating-point as an optional extension.
OpenCL 1.0 adds support for double precision floating-point as an optional extension. An application that wants to use double will need to include the #pragma OPENCL EXTENSION cl_khr_fp64 : enable
directive before any double precision data type is declared in the kernel code.
The lists of built-in scalar data types and vector data types are extended to include the following:
Type in OpenCL Language | Description | API type for application |
---|---|---|
double | A double precision vector | cl_double |
double2 | 2-component double vector | cl_double2 |
double4 | 4-component double vector | cl_double4 |
double8 | 8-component double vector | cl_double8 |
double16 | 16-component double vector | cl_double16 |
The double data type must confirm to the IEEE-754 double precision storage format.
Conversions from double to half are correctly rounded. Conversions from half to double are lossless.