Results 1 to 3 of 3

Thread: inconsistent use of 'double' in the specification?

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    2

    inconsistent use of 'double' in the specification?

    I started reading the specification for OpenCL, and admit I am somewhat confused about the data types section with respect to 'double'.

    based on 6.1.1, double is not a "built-in scaler data type."

    based on 6.1.3, double is not an "other built-in data type."

    So at this point, it seems either double is not built-in or it is not scaler.

    The description for "long double" in table 6.4 in section 6.1.4, suggests that double is scaler. It is also apparent that the word double is a reserved data type.

    So at this point, it seems that double is conclusively not built-in, but that perhaps a future version of OpenCL will support double.

    However, continuing on with the specification, I find example code in:

    "Section: 6.2.4.1 Reinterpreting Types Using Unions"

    that uses "double."

    So, does this example code not meet the specification?

  2. #2
    Junior Member
    Join Date
    Aug 2012
    Posts
    2

    Re: inconsistent use of 'double' in the specification?

    I guess I answered my own question, once I got to section 9.3

    In the process, I also noticed that section

    6.2.4.2 Reinterpreting Types Using as_typen()

    also uses 'double' in its example code.

    (so I guess these examples rely on an optional extension).

  3. #3
    Senior Member
    Join Date
    Dec 2011
    Posts
    161

    Re: inconsistent use of 'double' in the specification?

    "double" is an optional OpenCL extension. It is not required for an implementation to support to be OpenCL compliant.

    When supported, they are available in both scalar and vector form, and have intrinsic function support, etc. Basically, just like "float" but with more precision.

Similar Threads

  1. Inconsistent Results
    By mflamer in forum OpenCL
    Replies: 6
    Last Post: 06-06-2012, 10:58 PM
  2. inconsistent data
    By mustang in forum OpenCL
    Replies: 2
    Last Post: 03-02-2012, 05:16 AM

Posting Permissions

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