BITSELECT(3clc)
๐ BITSELECT(3clc) โ the OpenCL Manual, but make it cute ๐
okay bestie, pull up a chair, we're doing bitselect from the OpenCL manual and it's genuinely lowkey iconic ๐
โจ NAME โจ
bitselect โ each bit of the result is the corresponding bit of a if the corresponding bit of c is 0 ๐ซถ
gentype bitselect(gentype a, gentype b, gentype c);
halfn bitselect (halfn a, halfn b,
halfn c) // if half extension
enabled
๐ธ DESCRIPTION ๐ธ
okay so here's the whole vibe: every single bit of the result is the corresponding bit of a if the corresponding bit of c is 0 ๐
otherwise? it's the corresponding bit of b. that's it. that's the function. a little bit-picking queen ๐
๐ฆ NOTES ๐ฆ
if an implementation extends this specification to support IEEE-754 flags or exceptions, then all built-in relational functions shall proceed without raising the invalid floating-point exception when one or more of the operands are NaNs. so like, NaNs are not the drama here, periodt ๐
the built-in relational functions are extended with cl_khr_fp16(3clc) to include appropriate versions of functions that take half, and half{2|3|4|8|16} as arguments and return values โจ
the argument type gentype can be char, charn, uchar, ucharn, short, shortn, ushort, ushortn, int, intn, uint, uintn, long, longn, ulong, ulongn, float, floatn, double, and doublen. that's the whole roster, no cap ๐
๐ SPECIFICATION ๐
OpenCL Specification[1]
๐ SEE ALSO ๐
๐ AUTHORS ๐
The Khronos Group
๐ COPYRIGHT ๐
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 โญ
- OpenCL Specification โ page 264, section 6.12.6 - Relational Functions
and that's the whole page bestie ๐ this absolute banger was brought to you by The Khronos Group, dated 01/14/2021, filed under BITSELECT(3clc) โ go forth and select your bits, you main character ๐ซถ๐โจ
๐ฆ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 ยท other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 ยท other
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms