woronoi
|
|
« 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: GitHubDownload latest release: BuddhabrotCL
|
|
« Last Edit: July 01, 2016, 08:42:08 AM by woronoi, Reason: links to images »
|
Logged
|
|
|
|
lycium
|
|
« 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.cThis 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
|
|
« 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
|
|
« 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
|
|
« 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
|
|
« Reply #5 on: June 25, 2016, 10:03:14 PM » |
|
|
|
|
Logged
|
|
|
|
woronoi
|
|
« Reply #6 on: June 30, 2016, 04:47:59 PM » |
|
OpenCL Metropolis-Hastings. Naive method Metropolis-Hastings
|
|
|
Logged
|
|
|
|
|
ker2x
Fractal Molossus
Posts: 795
|
|
« Reply #8 on: September 13, 2016, 09:01:38 PM » |
|
a quick check show me we have very similar code (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 __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
|
|
|
|
Chillheimer
|
|
« 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
|
|
« Reply #10 on: September 14, 2016, 09:58:07 AM » |
|
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 (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 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 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
|
|
« Reply #11 on: September 27, 2016, 11:17:30 PM » |
|
|
|
|
Logged
|
--- Fractals - add some Chaos to your life and put the world in order. ---
|
|
|
woronoi
|
|
« 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
|
|
« 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!
|
|
|
Logged
|
--- Fractals - add some Chaos to your life and put the world in order. ---
|
|
|
mclarekin
|
|
« Reply #14 on: November 18, 2016, 04:21:36 AM » |
|
|
|
|
Logged
|
|
|
|
|