Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

TheDude

Gas OpenCL

I was wondering where I could learn how to make functions in the Gas OpenCL dop node? I could barely find any documentation on it aside from AMDs site, but that's a lot more low level programming related. Just looking for simple houdini-centric openCL demonstrations / examples.

 

Update: A friend Artem showed me where the kernels live $HFS/houdini/ocl/ -- You can open them up and have a lil dig around, but even the simplest functions take a lot of overhead to set up

Edited by TheDude
2 people like this

Share this post


Link to post
Share on other sites

You can download my OpenCL Wrangle SOP that comes with a preset for relaxing geometry. I plan to add more presets.

My Smooth SOP also has an OpenCL branch that's on by default. So you can check out that code too.

2 people like this

Share this post


Link to post
Share on other sites

Has anyone ever gotten the open cl dop to work on fields?

I've been trying to get a simple scenario to work where it essentially does:

density *= 2.;

 

The actual code I'm using is:

kernel void test(   
    global float* density_
)
{
  density_[0] = density_ * 2.0;
}

It throws an error saying no output field specified, I'm not sure if this is an issue with my code, or if this needs to be specified elsewhere on the dop itself?

 

Thanks!

Share this post


Link to post
Share on other sites

yes, it works well on volumes. Have a look inside $HFS/houdini/ocl/
The most basic example is : $HFS/houdini/ocl/sim/dissipate.cl
I'll post a file tomorrow, it doesn't seem to work well on my macbook pro at home 
<_<

Edited by bunker

Share this post


Link to post
Share on other sites

it might be that underscore after density.

 

Perhaps something like this...?

kernel void test(
		int stride_x, 
		int stride_y, 
		int stride_z, 
		int stride_offset,
    	global float * density
)
{
int idx = stride_offset +
	    get_global_id(0) * stride_x +
	    get_global_id(1) * stride_y +
	    get_global_id(2) * stride_z;

    float density_ = density[idx];

  density[idx] = density_ * 2.0;
}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now