Logo by rathinagiri - 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. April 26, 2024, 12:30:59 AM


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 2 [3] 4 5 6   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: CUDA Y.A.M.Z  (Read 14620 times)
Description: Yet Another Mandelbrot Zoomer
0 Members and 1 Guest are viewing this topic.
knighty
Fractal Iambus
***
Posts: 819


« Reply #30 on: April 10, 2014, 07:03:45 PM »

Thanks a lot.

recently had this error when increasing zoom past E-2023

------------------------------
*** MPROUN: Exponent overflow.
*** mpabrt: execution terminated, error code =69
Segmentation fault
------------------------------
Maybe because the number of digits is set to 2048 in main.cpp
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #31 on: April 10, 2014, 07:15:43 PM »

anticipated that and set it to 3192 @ around E-1800

I suspect it's in FillInCubic()
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
knighty
Fractal Iambus
***
Posts: 819


« Reply #32 on: April 10, 2014, 09:52:29 PM »

Ok! Azn
Finally, it compiled successfully using Qt5.2. I used QOpenGLFunctions for OpenGL extensions.
Nice application!
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #33 on: April 10, 2014, 11:46:15 PM »

cool smiley

re: FillInCubic()

extra_exponent normally ticks down to 0 and all is well, the problem is when converting from AP number to DOUBLE number, ARPRECs mp_real::mpmdc(); function is supposed to take care of this...

 /// from mp_real to double source code
  /**
   * This procedure takes the mp_real A, and splits it into
   * a double, b, and a exponent, n.
   *
   * On exit, the following should be roughly true:
   *
   *       a ==(roughly) b*2^n
   */
/// from mp_real to double source code

for some reason "n" = -21474836481 when extra_exponent reaches around 101 huh? before this "n" fluctuates between 0 and -720

I also had used mp_real::n_digits instead of mp_real::n_precwords in the mpmdc() but that didn't seem to have any effect, should be "1" erroneous values ignored?

« Last Edit: April 11, 2014, 12:04:50 AM by 3dickulus » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #34 on: April 12, 2014, 08:16:57 AM »

cool smiley

re: FillInCubic()

extra_exponent normally ticks down to 0 and all is well, the problem is when converting from AP number to DOUBLE number, ARPRECs mp_real::mpmdc(); function is supposed to take care of this...


... it was the Repeater test in CalculationManager class   embarrass
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #35 on: April 16, 2014, 04:24:45 PM »

I see Pauldebrot has come up with something re:glitches that looks really interesting, in the mean time, here's some of my results, partial glitch solving.
(gawdy colors accentuate blobs)



* glitch.1.jpg (93.62 KB, 1024x768 - viewed 220 times.)

* glitch.2.jpg (102.04 KB, 1024x768 - viewed 208 times.)
* kf2.glitch.txt (0.27 KB - downloaded 84 times.)
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #36 on: May 14, 2014, 09:02:04 PM »

I think I might be on to something...

this is DD's "Flake" location rendered in 309.6 sec with my C++ port of SFT, reference point picked automagically. I have been working on getting the engine as tight as I can before I start playing with a CUDA version, it might be a while and may be abandoned for a whack at porting kallesfraktaler2 to Qt/linux smiley I haven't posted the latest version of this code yet but if you want to play with it let me know and I'll make some time to zip it up.


* DD-Flake.jpg (252.21 KB, 1024x768 - viewed 213 times.)
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #37 on: June 09, 2014, 12:57:04 AM »

In porting SFT Java to C++ I'm reasonably sure that it's good because the C++ version reproduces all of the same glitches that the Java version shows. But before trying to implement glitch detection and correction I thought I would try a slightly different approach, that is, glitch avoidance through improved accuracy...

This code computes the magnitude of a complex number and avoids overflow, returns between 0 and inf, I have used this routine to replace (x*x)+(y*y) in the Details class and the Approximation class.  ( in theory this shouldn't work??? because it returns sqrt(x*x+y*y) but I'll let the result speak for itself )

Code:
/// compute the magnitude of a complex number.
double Approximation::cMag(double re, double im)
{
    double r;

    re = fabs(re);
    im = fabs(im);

    if (re > im) {
        r = fabs(im/re);
        return re*sqrt(1.0+r*r);
    }

    if (im == 0.0)
        return 0.0;

    r = fabs(re/im);
    return im*sqrt(1.0+r*r);
}

I also replaced (x*x)-(y*y) with (x-y)*(x+y) because...
"The expression x*x - y*y is more accurate when rewritten as (x - y)*(x + y) because a catastrophic cancellation is replaced with a benign one."

These two changes allow rendering of "Flake" (above) and "Polished Emerald" (below) much more accurately when compared with the original SFT code. I wish I had more time and brains to dedicate to this but so far so good smiley

Edit: yes I know it's not perfect but it's better than the blob that the java code rendered smiley


* Polished_Emerald.jpg (96.88 KB, 1024x768 - viewed 203 times.)
« Last Edit: July 25, 2014, 09:18:46 AM by 3dickulus » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #38 on: August 19, 2014, 02:12:58 PM »

for the latest installment in the Y.A.M.Z. file I would like to thank knighty for the win version of arprec lib and help with getting the QtCreator project to compile and run on windows  A Beer Cup A Beer Cup A Beer Cup

finally have Pauldebrot's glitch thing working, well, my version of it at least. cheesy

SFTC63 yeah that's right, it took me 63 versions to go from the original java to Qt C++ and add auto glitch detection, still needs a few more incarnations but I'm very happy with it so far.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
knighty
Fractal Iambus
***
Posts: 819


« Reply #39 on: August 19, 2014, 09:17:29 PM »

You are welcome.  cheesy
And thank you for the new version. I think it would be nice to provide a compiled version for those who don't want to install Qt and compile the project by themselves.
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #40 on: August 20, 2014, 12:53:32 AM »

@knighty: I do understand that everyone can't just throw together a dev box to compile and run this code so I have posted your win bin version on my website. I don't usually like to distribute Windows binaries created with Qt because of the required DLLs, mine may not be the same as yours so they must be included in the zip. I would much rather encourage all to figure out how to compile the Qt project so each has a version that is optimized for their machine/arch/OS. The thing is, that the code changes soooo fast that there are tweaks (yes already) that are not in the win bin vers, like, adjusted the glitch detection range (will probably add a menu/option for user adjustment) because as a value bound to the screen size it gets sloppy with small 256x192 or large images > 2048x1536 smiley

Another reason for preferring a source only dist is that it encourages hacking  wink

cheers mate!  A Beer Cup
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #41 on: August 20, 2014, 04:48:11 AM »

for anyone hacking the source...

1.  in file calculationmanager.cpp line 309 the count vs screensize test is working nicely like this...
Code:
            if(cnt > (mBuffer->GetWidth() >> 8)+1 )
            {
                newXOffset=x;
                newYOffset=y;
                break;
            }

at a screen width of 256 this is checking for 2 adjacent pixels flagged in the previous pass as failed, any less and we get no change.
edit:better but still not quite right, logic:blob on 512 screen would be twice as wide as on a 256 screen...

2. in file approximation.cpp line 409 the glitch flag test is working nicely @ < 1.0E-12 and  > 1.0E6

I also changed it so that the next search for a reference starts looking where the last search found one... the possibilities are endless smiley

« Last Edit: August 20, 2014, 03:51:20 PM by 3dickulus, Reason: still testing... » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
knighty
Fractal Iambus
***
Posts: 819


« Reply #42 on: August 20, 2014, 09:43:30 PM »

Ooops! I forgot to include "imageformats" and "platforms" directories to the package. I'll send you the updated package ASAP.
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #43 on: August 20, 2014, 10:18:53 PM »

Ooops! I forgot to include "imageformats" and "platforms" directories to the package. I'll send you the updated package ASAP.
...and that's why I like to encourage windows users to install Qt+MinGW, with that you can just load the project, compile it and make any adjustments you want to the GUI or source code.

a real bonus is the tool kit that comes with Qt, Creator is a good IDE (handles other languages too) and Designer is really awesome for building GUIs, hardly have to type anything smiley

the "imageformats" and "platforms" that I have installed on the Win7 box probably won't work so if you are up for putting together the Windows package I'll host it on my server.

I am currently fiddling with glitch detection, peanuts, large antlers and kidneys are easy but tiny antlers and single pixels are a bit more involved, v63 (currently on web site) is pretty good but needs improvement. Sometimes find a single pixel and re-render only find it's still there, I think it's because the x,y coords of a pixel are too coarse to nail the reference that may be at a sub-pixel level when working with lower screen resolutions, maybe need to try a couple of locations within a pixel to get the right ref. hack hack hack...
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #44 on: August 21, 2014, 11:52:59 AM »

The latest is SFTC64 with much improved glitch detection/correction... hack hack hack  wink

edit: I just finished running the comparison tests and v64 is a little faster than v63 cheesy

I think in the CUDA version I will be able to use double double type in place of long double as GPU only does 64 bit math and not 80 bit, but that just means it will have more range before going to higher precision functions, fortunately GArPrec has DD and QD types for running on the GPU.
GCC also has libquadmath.a that has __float128 and __complex128 types.

some values from quadmath.h...
Code:
#define FLT128_MAX 1.18973149535723176508575932662800702e4932Q
#define FLT128_MIN 3.36210314311209350626267781732175260e-4932Q
#define FLT128_EPSILON 1.92592994438723585305597794258492732e-34Q
#define FLT128_DENORM_MIN 6.475175119438025110924438958227646552e-4966Q
#define FLT128_MANT_DIG 113
#define FLT128_MIN_EXP (-16381)
#define FLT128_MAX_EXP 16384
#define FLT128_DIG 33
#define FLT128_MIN_10_EXP (-4931)
#define FLT128_MAX_10_EXP 4932
...adds the "Q" designation for using this type of number.
« Last Edit: August 21, 2014, 09:28:35 PM by 3dickulus, Reason: comparisons » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Pages: 1 2 [3] 4 5 6   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
CUDA Programming with Ruby Programming ker2x 1 3204 Last post September 28, 2010, 09:55:46 PM
by ker2x
New CUDA developer Meet & Greet chacharles 9 4199 Last post May 19, 2011, 01:06:00 PM
by chacharles
CUDA Benoit Announcements & News RogerDahl 7 4402 Last post April 26, 2011, 09:39:00 PM
by RogerDahl
mandelbulb3D and CUDA Programming scavenger 12 7724 Last post May 08, 2013, 01:25:50 PM
by elphinstone
Anyone played with Arrayfire ? (CUDA/OpenCL/CPU) Programming « 1 2 » ker2x 18 12987 Last post February 16, 2016, 11:35:27 AM
by ker2x

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.197 seconds with 24 queries. (Pretty URLs adds 0.016s, 2q)