Logo by kr0mat1k - Contribute your own Logo!
News: Visit us on facebook
 
*
Welcome, Guest. Please login or register. September 25, 2017, 05:09:00 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] 2   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: BuddhabrotCL  (Read 1355 times)
0 Members and 1 Guest are viewing this topic.
woronoi
Alien
***
Posts: 32



« on: June 17, 2016, 04:48:02 PM »

Suddenly, I have updated my C# OpenCL buddhabrot renderer. Metropolis-Hastings kernel and another external kernels.

Open source project: GitHub
Download latest release: BuddhabrotCL





« Last Edit: July 01, 2016, 08:42:08 AM by woronoi, Reason: links to images » Logged
lycium
Fractal Supremo
*****
Posts: 1157



WWW
« Reply #1 on: June 18, 2016, 01:15:46 AM »

Something seems a little strange about your use of OpenCL / parallel computation... for example in this code: https://github.com/nikvoronin/BuddhabrotCL/blob/master/src/BuddhabrotCL/cl_halton.c

This seems to be a single work item, which computes the data for the entire buffer; each work item is independent, so a better way would be to have each element compute the i'th element of randomXYBuffer, then you spawn bufferSize work items instead of 1.

I dare say it's not really worth using a separate kernel/buffer for this computation, can just be computed in the main Buddhabrot kernel.
Logged

woronoi
Alien
***
Posts: 32



« Reply #2 on: June 21, 2016, 07:47:09 PM »

I dare say it's not really worth using a separate kernel/buffer for this computation, can just be computed in the main Buddhabrot kernel.

You are right this is a weak place of program but I don't know how to avoid this. May be in future releases I will fix it.
« Last Edit: June 22, 2016, 03:55:15 PM by woronoi » Logged
woronoi
Alien
***
Posts: 32



« Reply #3 on: June 22, 2016, 03:46:55 PM »

In release v1.5 xorshift randomizer is in kernel. It become much faster.
Logged
woronoi
Alien
***
Posts: 32



« Reply #4 on: June 23, 2016, 02:16:23 PM »

New release v1.6 with updated kernels.




I have changed random number generator. The same speed but better visual quality.

Before



After




Logged
woronoi
Alien
***
Posts: 32



« Reply #5 on: June 25, 2016, 10:03:14 PM »

Why not to draw classic figures?








Logged
woronoi
Alien
***
Posts: 32



« Reply #6 on: June 30, 2016, 04:47:59 PM »

OpenCL Metropolis-Hastings.

Naive method




Metropolis-Hastings

Logged
ker2x
Fractal Molossus
**
Posts: 776


WWW
« Reply #7 on: September 13, 2016, 08:41:42 PM »

very cool, i'll take a look !
Feel free to explore my buddhabrot generator, you may find some code/optimisation you like : https://github.com/ker2x/buddha

I also have old buddhabrot openCL code here https://github.com/ker2x/WinBuddhaOpenCL

I'll check your code in the next few days  cheesy
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
ker2x
Fractal Molossus
**
Posts: 776


WWW
« Reply #8 on: September 13, 2016, 09:01:38 PM »

a quick check show me we have very similar code smiley
(well, i didn't implement MH in openCL but it's present in buddha++ in good old c++)

However i use a slightly different xorshift.
You may want to implement it and see if there is any difference, i'm very interested.
It should be slower however. GFX cards are not happy with this kind of code smiley

Code:
__kernel void xorshift(
    uint s1,
    uint s2,
    uint s3,
    uint s4,
    const int bufferSize,
    __global float2* randomXYBuffer
)
{
    uint st;
    float2 tmp;
    for(int i=0; i < bufferSize; i++)
    {
        st = s1 ^ (s1 << 11);
        s1 = s2;
        s2 = s3;
        s3 = s4;
        s4 = s4 ^ (s4 >> 19) ^ ( st ^ (st >> 18));
        tmp.x = (float)s4 / UINT_MAX;
        st = s1 ^ (s1 << 11);
        s1 = s2;
        s2 = s3;
        s3 = s4;
        s4 = s4 ^ (s4 >> 19) ^ ( st ^ (st >> 18));
        tmp.y = (float)s4 / UINT_MAX;
        randomXYBuffer[i] = tmp;
    }
}
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
Chillheimer
Global Moderator
Fractal Schemer
******
Posts: 967


Just another fractal being floating by..


chilli.chillheimer chillheimer
WWW
« Reply #9 on: September 13, 2016, 09:38:25 PM »

beautiful tool. had completely forgotten about it.
works like a charm and produces awesome pictures.

thank you very much for sharing this!
Logged

--- Fractals - add some Chaos to your life and put the world in order. ---
woronoi
Alien
***
Posts: 32



« Reply #10 on: September 14, 2016, 09:58:07 AM »

very cool, i'll take a look !
Feel free to explore my buddhabrot generator, you may find some code/optimisation you like : https://github.com/ker2x/buddha

I also have old buddhabrot openCL code here https://github.com/ker2x/WinBuddhaOpenCL

I'll check your code in the next few days  cheesy

Thnx a lot, great stuff. I think there are some useful parts for later development.


a quick check show me we have very similar code smiley
(well, i didn't implement MH in openCL but it's present in buddha++ in good old c++)

I have began the exploration of OpenCL from your WinBuddhaOpenCL but later rewrote a lot of code. That's why smiley


However i use a slightly different xorshift.
You may want to implement it and see if there is any difference, i'm very interested.
It should be slower however. GFX cards are not happy with this kind of code smiley

Xorshift isn't so good and produces repetitive artefacts when you implement it inside OpenCL kernel. I prefer Taus88. It generates smoother image and fast enough. You can compare those: Kernel --> RNG --> cl_taus88.c / cl_xorshift.c
Logged
Chillheimer
Global Moderator
Fractal Schemer
******
Posts: 967


Just another fractal being floating by..


chilli.chillheimer chillheimer
WWW
« Reply #11 on: September 27, 2016, 11:17:30 PM »

I thought I'd post a few images to show what awesome looking results this great program gives.
thx again for sharing this with us!






Logged

--- Fractals - add some Chaos to your life and put the world in order. ---
woronoi
Alien
***
Posts: 32



« Reply #12 on: November 17, 2016, 09:10:54 AM »

Minor changes. Just added choice of compute devices.

Direct link to download: BuddhabrotCL-bin-1.8.2.zip

Logged
Chillheimer
Global Moderator
Fractal Schemer
******
Posts: 967


Just another fractal being floating by..


chilli.chillheimer chillheimer
WWW
« Reply #13 on: November 17, 2016, 04:21:44 PM »

awesome!
this also solved the problem that my pc used only one of the 8 cores.. computation is now 8 times faster- wohooo! smiley
Logged

--- Fractals - add some Chaos to your life and put the world in order. ---
mclarekin
Fractal Senior
******
Posts: 1735



« Reply #14 on: November 18, 2016, 04:21:36 AM »

@ Chillheimer.  8 times faster, that must feel good. afro afro afro

@woronoi. I love the speed of OpenCL.

And you have made choosing compute_device so simple afro afro afro
Logged
Pages: [1] 2   Go Down
  Print  
 
Jump to:  


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.161 seconds with 27 queries. (Pretty URLs adds 0.014s, 2q)