OpenCL+ SOP

   2839   2   2
User Avatar
Member
122 posts
Joined: June 2019
Offline


I'm creating a SOP to simplify OpenCL workflow. Basically the idea is to have at least something similar to VEX on GPU.
Of course it's still OpenCL, so there are plenty of limitations and you still have to think about race conditions and stuff. However I've tried to automate all the boilerplate code so you just write an actual function.

Features:
  • Autogenerated kernel code and bindings. You just write the kernel body.
  • All bindings and parameters described in the code as special pragma directives (like #bind Cd{readonly}). Parser will try to find appropriate parameter in input and bind it so you don't have to specify if Cd is attribute, volume or VDB.
  • For better ux all kernel parameters are additionally promoted to spare parameters on the node (like in wrangles for ch calls)
  • Support for color ramps.
  • Support for vector volumes.
  • Special image mode for kernel to imitate COP context for 2D volumes with image addressing, sampling modes etc (I hope we'll have image objects support in the future, currently there's a lot of overhead)
  • Additional noises. Worley, value, gradient. They're not direct VEX ports, but it's based on HDK-consistent hash so it is possible to have deterministic random across VEX and OpenCL.
  • Jinja as a fancy preprocessor with separate python snippet.

Currently I'm adding a support for worksets and some helper functions. Also as pycparser is packaged to Houdini it's possible to push it even further with auto-binding and auto-creating attributes by name and even automating writeback kernels, though I'm not sure if it's worth it. It won't be vex anyway and the main idea with this sop is just to make life a little bit nicer with OpenCL.

There are tons of macros and additional headers so it's not possible to pack it to a single hda. I'll create a package and post a github link here.

Attachments:
opencl_plus.png (1.2 MB)

User Avatar
Member
122 posts
Joined: June 2019
Offline
I've made the SOP available in the package: https://github.com/igor-elovikov/hipie [github.com]
A little bit information: https://github.com/igor-elovikov/hipie/blob/main/help/OpenCL_Plus.md [github.com]

I'm not sure about practical use of it, but it definitely helps to write kernels much quicker. Houdini actually appears as a really nice sandbox for playing with compute.
User Avatar
Member
31 posts
Joined: Dec. 2012
Offline
That's great I will tried it !
maybe, you could make one for Cop's the compositing tools are lacking of fast nodes.
—————–
Heribert


+heribertraab.com
  • Quick Links