Archived post by mysterypancake

i put some info about worksets in this section github.com/MysteryPancake/Houdini-OpenCL?tab=readme-ov-file#worksets

the vellum thing above also uses worksets/graph color

there’s a few things that can be changed before running the kernel one is the number of workitems by using worksets as Jake said “`cpp // In VEX, runs the kernel 1 time with at least 6 workitems i[]@offsets = {0}; // this doesn’t affect any IDs but it gets passed as a kernel argument I[]@sizes = {6}; “` “`cpp // In OpenCL, the offset and size is passed from the VEX array // Note get_global_id(0) still starts at 0 even with multiple worksets kernel void kernelName( int color_offset, // offset number from i[]@offsets int color_size, // size number from i[]@sizes (not rounded up) … ) { … } “` the other is the [local workgroup size](github.com/MysteryPancake/Houdini-OpenCL?tab=readme-ov-file#changing-the-local-workgroup-size) “`cpp // Force the local workgroup size to 48 __attribute__((reqd_work_group_size(48, 1, 1))) @KERNEL { // This should print “Local size = 48” printf(“Local size = %d”, get_local_size(0)); } “`

The number of workitems it gives you always rounds up based on the local workgroup size

so if you did `i@[]sizes = {4}` but `get_local_size(0)` was 12, it gives you 12 workitems instead

this usually leads to [extra workitems you need to skip over](github.com/MysteryPancake/Houdini-OpenCL?tab=readme-ov-file#bounds-checking)