Logo by visual - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. September 19, 2021, 03:25:18 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Arbitrary Floating Points on GPU ?  (Read 2603 times)
0 Members and 1 Guest are viewing this topic.
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« on: January 16, 2010, 03:15:09 AM »

i am thinking about how to implement arbitrary floating point on a gpu, and it all breaks down to
using fixed point numbers as pixel elements ( a number with 256 bits would use 16x16 Pixel ) and
calculate the math on it ...

so, the standard, like +,-,*,/ is in my sight and i have an idea how to implement it, but i am wondering
how to implement the complicated stuff like exponentiation, squaring, rooting, sine and cosine and stuff ..  huh? huh? huh? huh? huh?
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Snakehand
Guest
« Reply #1 on: January 16, 2010, 10:03:05 AM »

I think the main difficulty with arbitrary precision mathematics on the GPU is to organize streams (large datasets) and functions in such a way that you can pass these large values between them. FOr instance on ATI a function that doesn't write its output to a stream can at most return a 128 bits value. So you might have to use a C style preprocessor that inlines such functions call. For mandelbrot and mandelbulb the usual iterative approach will involv numbers that are small (ex < 2.0) so fixed point will be the most appropriate to use. DE will be much harder where you have to do logarithms. I can imagine that code will have to be rewritten so that you don't have a GPU function that marches a single ray, but instead calculates the the size of the next step for a single ray, and the call those repeatedly.

128 bits precision would be the "easiest" to do, more than that and your numbers will have to be placed in streams, and worked on in memory rather than in registers. Cached memory access is very fast, but since streams are generally the objects passed in CPU->GPU calls, and registers are used in GPU functions, more of program logic will have to be done by the CPU, and the GPU will just do the dumb crunching of the numbers.

Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #2 on: January 16, 2010, 12:40:51 PM »

i think the unmbers could be represented as arbitrary long chunks on a bitmap stream input, and
ohne layer of those numbers would have to go through many steps on the gpu ... i want arbitrary
depth ... fast
Logged

---

divide and conquer - iterate and rule - chaos is No random!
cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #3 on: January 16, 2010, 01:30:26 PM »


Double precision can be emulated by combining two single precision floats, as detailed in this
CUDA forum posting.

http://forums.nvidia.com/index.php?showtopic=73067

You lose about factor 10-20 in speed, so much of the GPU's speed advantage is lost.

ATI cards should do better with integers than nVidia cards, because these can only multiply
two 24 bit precision numbers in 4 clock cycles (they are re-using the integer parts of the
floating point ALU, which only requires 24 bits of mantissa to work with). So working with
32 bit ints is slower on nVidia than working with floats.

Christian
Logged
cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #4 on: January 16, 2010, 01:31:34 PM »

oops double posting
« Last Edit: January 23, 2010, 05:27:51 PM by cbuchner1 » Logged
Melancholyman
Guest
« Reply #5 on: January 20, 2010, 04:10:39 AM »

i think the unmbers could be represented as arbitrary long chunks on a bitmap stream input, and
ohne layer of those numbers would have to go through many steps on the gpu ... i want arbitrary
depth ... fast

 grin
Logged
hobold
Fractal Bachius
*
Posts: 573


« Reply #6 on: February 05, 2010, 04:44:43 PM »

Don't try to fly before you can run. Take it step by step. Start with basic arithmetic for "arbitrarily" large integers. Once you are done, you will have learned how and why it works. The knowledge gained will enable you to extend your program to fixed point fractional numbers (which already suffice for a lot of fractal purposes). And this in turn will pave the way for the transition to floating point. And then, finally, you will implement trigonometric and transcendental functions.

Don't look to far beyond the horizon or you will be discouraged by the vast distance still ahead of you. Take it step by step, and direct your attention to your immediate surroundings. The journey is a rewarding one. If you ever need to ask for directions, we'll be here. I am quite sure that some of us will know the way, even if we haven't taken the exact route that you are exploring. :-)
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Floating Heavy Metal 1 Mandelbulb 3d MarkJayBee 0 1544 Last post April 24, 2010, 03:49:02 PM
by MarkJayBee
Floating points KRAFTWERK FractalForums.com Banner Logos KRAFTWERK 0 1388 Last post July 06, 2010, 10:12:08 AM
by KRAFTWERK
Ray Tracing from an arbitrary view point Programming asimes 10 1401 Last post January 05, 2013, 09:09:40 PM
by asimes
SuperFractalThing: Arbitrary precision mandelbrot set rendering in Java. Announcements & News « 1 2 ... 16 17 » mrflay 252 77079 Last post August 17, 2016, 11:59:31 PM
by cKleinhuis
*Continued* SuperFractalThing: Arbitrary precision mandelbrot set rendering in Java. Announcements & News « 1 2 ... 23 24 » hapf 347 28212 Last post September 28, 2017, 10:20:19 PM
by claude

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.171 seconds with 25 queries. (Pretty URLs adds 0.01s, 2q)