Get OpenCL preferred workgroup size to a detail attribute?

   1552   2   0
User Avatar
Member
13 posts
Joined: Sept. 2021
Offline
Hi! I'm playing with the OpenCL node inside Houdini and I was testing out performance optimizations on my nbody simulation code. The Houdini OpenCL node has a optional detail attribute for specifying worksets - OpenCL offers an attribute which gets each device's optimal workgroup size (CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE ) - I was wondering if there was any way to query this attribute to Houdini - maybe a Python SOP + some inline C++?

I also wanted to ask, is there a way to extend the attribute arrays that are sent to the GPU? e.g. I wanted to send a position attribute array but make the buffer 2x longer (to save in additional positions needed throughout the multiple kernels)

If anyone has any advice on how to achieve any of these it'd be much appreciated!
User Avatar
Member
40 posts
Joined: Feb. 2018
Offline
Also looking for an answer to this..

My current understanding is that the `worksets_length` attribute actually controls the global size. Houdini dictates the local size which you cannot(?) change. Am I right about this?
User Avatar
Member
13 posts
Joined: Sept. 2021
Offline
AlanZ
Also looking for an answer to this..

My current understanding is that the `worksets_length` attribute actually controls the global size. Houdini dictates the local size which you cannot(?) change. Am I right about this?

Hey! Late reply, but after doing some testing that is correct - Atleast on my PC Houdini's maximum work group size is always 256. By splitting your geo into worksets Houdini actually executes a separate kernel call for each workset (therefore worksets != workgroups). If you want to execute everything in one kernel call and use worksets, you have to make sure none of your workset lengths exceed this maximum value (256)(?) and have the Single Workgroup checkbox enabled.
  • Quick Links