opencl baby steps

   620   2   3
User Avatar
Member
874 posts
Joined: 10月 2008
Offline
I'm trying to wrap my head around the opencl sop by walking through it with baby steps. What's wrong in the following code?

// This code multiplies each voxel in the density volume by 0.5

// Bindings
#bind vdb &density float
#bind point &P float3

@KERNEL
{
    float3 pos = @P;
    float d = @density.worldSample(pos);
    d *= 0.5;
    @density.set(d);
}
--
Jobless
User Avatar
Member
184 posts
Joined: 2月 2016
Offline
The problem is that a vdb does not have v@P, use @nameofvolume.pos instead
https://www.sidefx.com/docs/houdini/vex/ocl.html#vdb-binding-methods [www.sidefx.com]

// Bindings
#bind vdb &density float

@KERNEL
{
    float3 pos = @density.pos;
    float d = @density.worldSample(pos);
    d *= 0.5;
    @density.set(d);
}
User Avatar
Member
874 posts
Joined: 10月 2008
Offline
Related question. How do I get this code to run in a gasopencl in a dopnet? It looks like something needs to be done with the binding but I don't know where.
--
Jobless
  • Quick Links