GET_NUM_GROUPS(3clc)

πŸ“¦
version 1.0~svn33624 Β· 3 versions
, in ubuntu jammy, ubuntu noble

πŸ’– GET_NUM_GROUPS πŸ’–

okay bestie, we're in the OpenCL Manual today and the page we're stanning is GET_NUM_GROUPS(3clc). pull up a chair, grab a strawberry πŸ“, this one's short and sweet and honestly iconic for it.


✨ NAME ✨

get_num_groups β€” returns the number of work-groups that will execute a kernel.

like, literally the whole personality. it counts your work-groups. that's the job. πŸ’…

size_t get_num_groups(uint dimindx);

that's the signature, copy it exactly, no cap.


🌸 DESCRIPTION 🌸

so here's the tea: get_num_groups() returns the number of work-groups that will execute a kernel, for the dimension you point at with dimindx.

what's a valid dimindx, you ask? valid values are 0 up to get_work_dim(3clc)() - 1. that's the range, bestie, respect the range. 🫢

and if you pass literally any other value of dimindx? no drama, no error, get_num_groups() just returns 1. it's giving "fine, i'll do it myself." 😭

one more thing, and this is the important one: for clEnqueueTask(3clc), this always returns 1. always always. no matter what. periodt. πŸ‘‘


πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1]

(iykyk β€” the footnote at the bottom has the receipts 🧾)


πŸ‘€ SEE ALSO πŸ‘€

go read those too, they're the friend group and they all slay together. 🌈


πŸ‘‘ AUTHORS πŸ‘‘

The Khronos Group

(the icons themselves, fr fr)


Copyright Β© 2007-2011 The Khronos Group Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the following condition: the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Materials.

yes bestie, that's the whole legal paragraph, every single clause, don't skip it, the lawyers are watching πŸ™ˆ

πŸ“ NOTES πŸ“

  1. OpenCL Specification β€” page 242, section 6.12.1 - Work-Item Functions

and that's the whole page, bestie!! πŸŽ€ the Khronos Group wrote this one, it's dated 01/14/2021, and it lives under GET_NUM_GROUPS(3clc) in the OpenCL Manual. now go count some work-groups, you're gonna ate that kernel. bye!! πŸ¦‹πŸ’–βœ¨

πŸ“¦ where this page comes from