Results 1 to 3 of 3

Thread: How can I simulate double precision?

  1. #1

    How can I simulate double precision?

    I'm solving a problem that uses double precision on C++, but double precision is not supported by all hardware, specially the hardware I'm currently working on. In that case, how can I simulate the double precision I need on OpenCL? I've looked ate those float4, etc, but haven't figured out if they may be useful for what I need.
    Can anyone one give a clue about it, and possibly indicate me some code to look at?


  2. #2
    Junior Member
    Join Date
    Mar 2010

    Re: How can I simulate double precision?

    See section 9.3 of the specification document... basically put the macro #pragma OPENCL EXTENSION cl_khr_fp64: enable and then normally, declare as cl_double, cl_double2, ... remember that they are too slow in comparison with float and half, so limit yourself to the use of it!

  3. #3
    Senior Member
    Join Date
    Sep 2002
    Santa Clara

    Re: How can I simulate double precision?

    #pragma OPENCL EXTENSION cl_khr_fp64 : enable is used to enable the double precision extension in your OpenCL program. However, it can only be enabled if this extension is supported by the OpenCL implementation. This is not the way to emulate double precision floating-point arithmetic.

    You will need to write code to emulate DP basic operations.

Similar Threads

  1. double precision math builtins on OSX
    By jhludwig in forum OpenCL
    Replies: 4
    Last Post: 05-02-2011, 03:33 PM
  2. Enabling double precision
    By louiswu in forum OpenCL
    Replies: 1
    Last Post: 11-24-2009, 05:02 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
Proudly hosted by Digital Ocean