Click here to Skip to main content
Licence Zlib
First Posted 29 Nov 2005
Views 346,308
Bookmarked 78 times

Generating Fractals with SSE/SSE2

By | 29 Nov 2005 | Article
An article on generating Mandelbrot and Julia sets using Intel's Streaming SIMD Extensions (SSE, SSE2).
 

License

This article, along with any associated source code and files, is licensed under The zlib/libpng License

About the Author

Peter Kankowski

Software Developer

Russian Federation Russian Federation

Member

Peter lives in Siberia, the land of sleeping sun, beautiful mountains, and infinitely deep snow. He recently started a wiki about algorithms and code optimization, where people could share their ideas, learn, and teach others.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalsource contains a virus PinmemberCem Usta21:57 3 May '09  
GeneralRe: source contains a virus Pinmembersergeykkk15:29 25 Aug '11  
GeneralRe: source contains a virus PinmemberPeter Kankowski16:31 25 Aug '11  
GeneralRe: source contains a virus Pinmembersergeykkk18:28 25 Aug '11  
GeneralFractal Dimension Indicator Formula Code PinmemberYIYI2223:50 30 Jul '08  
Generaltypo PinmemberSavageJ20:11 3 Jun '06  
GeneralSimplified Program PinmemberPeter Kankowski18:30 26 May '06  
GeneralIterations greater than 64 [modified] Pinmemberzenzero11:46 26 May '06  
GeneralRe: Iterations greater than 64 Pinmemberzenzero13:22 26 May '06  
GeneralRe: Iterations greater than 64 PinmemberPeter Kankowski18:23 26 May '06  
GeneralRe: Iterations greater than 64 Pinmemberzenzero1:08 27 May '06  
GeneralCould not compile on VS 2005 Pinmemberzenzero7:54 26 May '06  
GeneralRe: Could not compile on VS 2005 Pinmemberzenzero10:20 26 May '06  
GeneralBenchmark PinmemberxKuemmelx12:42 8 May '06  
GeneralRe: Benchmark PinmemberPeter Kankowski14:45 9 May '06  
GeneralRe: Benchmark PinmemberxKuemmelx21:54 10 May '06  
GeneralRe: Benchmark PinmemberxKuemmelx11:34 15 May '06  
GeneralAnother approach, removing branches PinmemberArne Thormodsen12:24 10 Apr '06  
GeneralRe: Another approach, removing branches PinmemberPeter Kankowski0:25 11 Apr '06  
GeneralRe: Another approach, removing branches PinmemberArne Thormodsen13:33 11 Apr '06  
GeneralCode Questions/Comments PinmemberxKuemmelx2:40 8 Mar '06  
GeneralRe: Code Questions/Comments PinmemberPeter Kankowski15:51 8 Mar '06  
Hi, Michael,

thank you for your letter.

 
xKuemmelx wrote:
As far as I can see you are calculating either 2 or
4 pixels at one time in your routines (single or double
precision SSE/SSE2. I just wonder if there isn't a huge
penalty if the neighbour pixels have very different
depth of iterations, what sometimes is true especially
for the spiral areas in a mandelbrot fractal...?

There is no problem, because operations are done in parallel.
Let's say you have 2 neighbouring pixels: the first
with 1 iteration, and the second with 5 iterations.
Imagine that one iteration takes 1 second (of course,
in the real program it takes less time). If you process
two pixels in parallel, you have to do 5 iterations
in 5 seconds. But it's the best you can do with this
two pixels, because processing them serially takes
1+5=6 seconds. Here is a simple diagram:
                  Parallel computation  Serial computation
the first pixel   A - - - -             A
the second pixel  B B B B B               B B B B B
          seconds 1 2 3 4 5             1 2 3 4 5 6
And why we can't reorder pixels to get use of 4 wasted
seconds (marked with - on the diagram)? Because it's too
complex. We don't know how much does the depth of iterations
vary between two pixels before we start calculating this
pixels.
 
xKuemmelx wrote:
When you go deeper and deeper in the fractal, is
single precision a problem, so that you got to do
double precision to get a proper result ?

Yes, you have to do double precision in such cases.
 
Good luck,
Peter Kankowski
GeneralRe: Code Questions/Comments PinmemberxKuemmelx20:24 8 Mar '06  
GeneralRe: Code Questions/Comments PinmemberPeter Kankowski1:29 9 Mar '06  
GeneralFFFF: Open Source Pinmembermaihem7:49 15 Jan '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120529.1 | Last Updated 29 Nov 2005
Article Copyright 2005 by Peter Kankowski
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid