GET_GLOBAL_ID(3clc)

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

✨ get_global_id β€” the OpenCL manual, but make it cute ✨

okay bestie, so this is page GET_GLOBAL_ID(3clc) from the OpenCL Manual (yes, the real one, The Khronos Group runs this account πŸ’…) and I'm about to make work-item IDs make so much sense to you. no cap.


🌸 NAME 🌸

get_global_id β€” it hands you back the unique global work-item ID value for the dimension identified by dimindx. that's it, that's the whole vibe.

size_t get_global_id(uint dimindx);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like. the global work-item ID is literally your ID, bestie. it's figured out based on the number of global work-items that were specified to execute the kernel. every work-item gets its own little name tag πŸŽ€

the valid values of dimindx are 0 through get_work_dim(3clc)() - 1. that's the range. that's it.

⚠️ for other values of dimindx, get_global_id() returns 0. like, it just gives up and hands you a zero. no drama, no error, just 0. πŸ™ˆ

also, for clEnqueueTask(3clc), this returns 0. iconic of it.


πŸ‘‘ SPECIFICATION πŸ‘‘

OpenCL Specification[1]


πŸ’– SEE ALSO πŸ’–


🫢 AUTHORS 🫢

The Khronos Group


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 condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.


πŸ“ NOTES πŸ“

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

and that's the whole page, babe πŸ’œ go forth and index your work-items, you absolute main character. written by The Khronos Group, dated 01/14/2021, filed under GET_GLOBAL_ID(3clc) β€” mwah, slay, periodt ✨

πŸ“¦ where this page comes from