Game
Robot Unlock
13 years ago

OpenCL Experiments


<div class=”separator” style=”clear:both;text-align:center;”>

</div>While there are many applications (not necessarily scientific ones) for OpenCL and the technology has been available for some years, I have yet to see any piece of software that took advantage of this. There aren’t even many tutorials and books on OpenCL. Now, I’m no expert but I thought I could make some OpenCL demos and share them on Github. Here’s what I have so far:

Simulation of repulsive particles - similar to the n-body problem, except here all particles want to stay apart and all particles are attracted to just one. This makes them chase each other which results in some neat patterns and dynamics.Hillclimbing! - the hillclimbing algorithm is a very simple stochastic optimization algorithm. The algorithm can be described as follows: a dwarf is placed in the search space (the hills). The dwarf chooses a random direction and goes that way as long as he keeps climbing, after which he chooses another direction and does that until he’s on top of the hill. Obviously the hillclimbing algorithm is prone to getting stuck in local maxima, but that’s where OpenCL comes in to save us: initialize N parallel hill climbers (dwarves) from random positions in the search space. Thus, we get N local maxima, one of which is the global maxima (hopefully).Particle Swarm Optimization (actually Parallel Asynchronous PSO) - I’ve already covered PSO in this online demo and extensively in my Bachelor’s graduation thesis and Gloptat. PAPSO is more suitable for the GPU since synchronizing “threads” is costly. There is also no clear disadvantage in using asynchronous PSO and there are even scientific studies that show how reliable PAPSO is. PAPSO is even closer to what it simulates, to the natural model.Shadow demo - it’s just a little demo showing a simple way to compute shadows using rays. It also shows how you can have more than one kernel on the same context/queue and that they can use the same allocated global memory without issues.



0 comments

Loading...

Next up

Shoobies leave a sticky trail of mucus in their wake, which can impede movement for any creature that steps in it.

"Our work is never over" they said.

In the quest for accessibility, I'm adding Resurrection Shrines for players on the 'novice' end of the platforming spectrum.

In order to unlock the power of a Shrine, you must collect 3 'Souls' from your dead corpses! (the floating blue orbs)

Strange Umbrella

Regional Bulbasaur. #Pokemon

Explosive domino effect

Path of Kami, running around the shrine area

blender animation experimentation, getting the hang of things fast. arms, rig, & gun models by me ofc

The Authority decided to investigate the Basement and leads to recovering classified documents Fun fact: The building has 928 doors and not 1000 doors. #horror

Annie of the stars