Support for double floating-point precision.

#pragma OPENCL EXTENSION cl_khr_fp64 : enable


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.


OpenCL Specification

Also see

clGetDeviceInfo, EXTENSION

Copyright © 2007-2009 The Khronos Group Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.