Results 1 to 3 of 3

Thread: cl_khr_fp64 becoming an "optional core feature"

  1. #1
    Join Date
    Jul 2013

    Question cl_khr_fp64 becoming an "optional core feature"


    I was just reading the OpenCL 1.2 specification and I noticed that between 1.1 and 1.2 the cl_khr_fp64 went from being an extension to an "optional core feature". From appendix F.2
    Double-precision is now an optional core feature instead of an extension.
    Out of curiosity what is the difference? Extensions to OpenCL are optional but an "optional core feature" is also optional so I don't really see what the difference is.


  2. #2
    The difference is that you don't need to enable the extension via the compiler directive.

    Accordying to the spec, Section 9.1, if a developer wants to use an optional extension in his program, he has to provide a directive to the compiler to enable this extension:
    "#pragma OPENCL EXTENSION extension_name : behavior"
    So any kernel in OpenCL 1.1 which used Double-prescision, the developer had to include one of the following directives in the OpenCL program, otherwise the compiler should have failed to compile the code: "#pragma OPENCL EXTENSION cl_khr_fp64: enable" or #pragma OPENCL EXTENSION all : enable"

    In OpenCL 1.2, since it is optional, the directive is no longer needed. Yet, the developer needs to query CL_DEVICE_DOUBLE_FP_CONFIG and see that it's not NULL (if NULL, doubles are not supported)

    Hope it helps,

  3. #3
    Join Date
    Jul 2013
    Thanks for the clarification.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts