Andrei Korolev

3dsmile.cg

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

OpenCL QuadTree for N body optimisation May 25, 2024, 4:33 p.m.

Thank you very much for this reply!

alexwheezy
Perhaps you should watch official masterclasses on this subject.
The only masterclass I could find is for H16.5, it was very helpful, but not deep enough.

The link you provided is a goldmine, cheers!

OpenCL QuadTree for N body optimisation April 28, 2024, 5:38 a.m.

Hi there!

I'm currently working on a gravity simulation.
I was able to get quite good perfomance using OpenCL node, using brute force approach I'm getting around 30fps at 20 000 points.

But I want to improve the speed thurther, so I stumbled upon Barnes-Hut approximation approach, and it uses QuadTree/OctTree to minimize the amount of calculations needed.
Article on this exact problem [diglib.eg.org]

So naturally I tried to create a QuadTree using OpenCL, but run into a couple of roadblocks.

Firstly, I couldn't find any documentation on how the OpenCL implemented in Houdini, maybe i missed something?

Secondly, as far as I ubderstand, to create a QuadTree, I need to declare a certain datastructure for a node in the tree, and it needs to hold an array of points.
So I need an array of arrays, but then I try to include this variables in the main kernel, it gives an error that this variable is not bound to an attribute as i undarstand.
It works in a separate kernel it seems, but not in the main one(see the screenshot)

I would appreciate any comments.
Granted, I am absolutely not a coder, so these questions might be stupid, but I'm trying to solve this problem for a solid week now, and running out of ideas where to look for answers.