Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8921533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:34:14+00:00 2026-06-15T06:34:14+00:00

I’m working with CUDA (GPGPU programming) for some research and the innate Double Precision

  • 0

I’m working with CUDA (GPGPU programming) for some research and the innate Double Precision performance suffers compares to the Single Precision performance (by a factor of 24!), due to a new hardware architecture. I’ve decided to try and use two uint’s to represent one double. This way I could run DP calculations without a significant performance hit.

For example, let’s say we want to represent the double 10.12 using this method.

uint real = 10, decimal = 12;

Therefore; ‘real.decimal’ visually represents our double.

Let’s call this type a ‘single’.

Given:
single a = 10.12, b = 20.24;

What would be an efficient algorithm to multiply, divide, add, and subtract two single’s?

single c = a * b;

Please remember, for this to work, it’s not possible to do ANY DP calculations or use a data type larger than 32 bits.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:34:15+00:00Added an answer on June 15, 2026 at 6:34 am

    If you want to replace double precision, you could look into using a “double single” representation where the operands are pairs of single-precision numbers refered to as the “head” and the “tail”, and which satisfy the normalization requirement that |tail| <= 0.5 * ulp (|head|). CUDA’s float2 is the appropriate type to hold the pairs of floats needed. For example, the less signficant x-component would represent the “tail”, and the more significant y-component the “head”.

    Note that this does not provide exactly the same accuracy as double precision. The precision of this representation is limited to 49 bits (24 bits from each of the single-precision mantissa plus 1 bit the sign bit of the tail) vs 53 for double precision. The operations won’t provide IEEE rounding, and the range may also be reduced somewhat due to overflow of temporary quantities inside the multiplication code. Subnormal quantities may also not be accurately representable.

    I don’t think the performance will be significantly better than using the native double-precision operations of your GPU, as register pressure will be higher and the number of single-precision operations required for each “double single” operation is fairly substantial. You could of course just try and measure the performance for both variants.

    Below is an example of an addition in “double single” format. The source of the algorithm is noted in the comment. I believe that the cited work is in turn based on the work of D. Priest who did research in this subject matter in the late 1980s or early 1990s. For a worked example of a “double single” multiplication, you could take a look at the function __internal_dsmul() in the file math_functions.h that ships with CUDA.

    A quick remark on 64-bit integer operations in CUDA (as one commenter noted this as a potential alternative). Current GPU hardware has very limited support for native 64-bit integer operations, basically providing conversion from and to floating-point types, and indexing using 64-bit addresses in loads and stores. Otherwise 64-bit integer operations are implemented via native 32-bit operations, as one can easily see by looking at disassembled code (cuobjdump –dump-sass).

    /* Based on: Andrew Thall, Extended-Precision Floating-Point Numbers for GPU 
       Computation. Retrieved from http://andrewthall.org/papers/df64_qf128.pdf
       on 7/12/2011.
    */
    __device__ float2 dsadd (float2 a, float2 b)
    {
        float2 z;
        float t1, t2, t3, t4, t5, e;
    
        t1 = __fadd_rn (a.y, b.y);
        t2 = __fadd_rn (t1, -a.y);
        t3 = __fadd_rn (__fadd_rn (a.y, t2 - t1), __fadd_rn (b.y, -t2));
        t4 = __fadd_rn (a.x, b.x);
        t2 = __fadd_rn (t4, -a.x);
        t5 = __fadd_rn (__fadd_rn (a.x, t2 - t4), __fadd_rn (b.x, -t2));
        t3 = __fadd_rn (t3, t4);
        t4 = __fadd_rn (t1, t3);
        t3 = __fadd_rn (t1 - t4, t3);
        t3 = __fadd_rn (t3, t5);
        z.y = e = __fadd_rn (t4, t3);
        z.x = __fadd_rn (t4 - e, t3);
        return z;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.