ISLESSEQUAL(3clc)

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

πŸ’– ISLESSEQUAL β€” the 3clc era πŸ’–

okay bestie, welcome to the OpenCL manual, this one's called islessequal(3clc) and it's literally just here to answer one question: is x less than or equal to y? that's it. that's the whole personality. πŸ¦‹


✨ NAME ✨

islessequal β€” the compare of x <= y. no cap.

here's every single form it comes in, exactly as written, don't @ me:

int islessequal(float x, float y);

intn islessequal(floatn x, floatn y);

int islessequal(double x, double y);

longn islessequal(doublen x, doublen y);

int islessequal (half x, half y)   //
if half extension enabled
shortn islessequal (halfn x, halfn y)
// if half extension enabled

see those last two? they only show up if the half extension is enabled. gatekept fr fr. πŸ™ˆ


🌸 DESCRIPTION 🌸

it returns the component-wise compare of x <= y. component-wise meaning it goes through your vectors element by element, one by one, like a bestie checking every single text in the group chat. πŸ’…


πŸŽ€ NOTES πŸŽ€

okay so here's the tea, and this part actually matters:

  • if an implementation extends this spec 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. yes, even with NaN in the mix. iconic behaviour honestly. πŸ‘‘
  • the built-in relational functions get extended with cl_khr_fp16(3clc) to include the appropriate versions of functions that take half, and half{2|3|4|8|16} as arguments and return values. glow up courtesy of an extension. ✨
  • for scalar argument types, the function returns a 0 if the specified relation is false and a 1 if the specified relation is true. clean, simple, no drama.
  • for vector argument types, it shall return a 0 if the specified relation is false and a - 1 (i.e. all bits set) if the specified relation is true. not a plain 1, bestie β€” all bits set. that's the vibe check right there. 🫢
  • and here's the big one: the relational functions isequal, isgreater, isgreaterequal, isless, islessequal, and islessgreater always return 0 if either argument is not a number (NaN). meanwhile isnotequal returns 1 if one or both arguments are not a number (NaN) and the argument type is a scalar, and returns -1 if one or both arguments are not a number (NaN) and the argument type is a vector. so isnotequal is the one friend who says yes when everyone else says no. main character energy tbh. 😭

πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1] β€” go read it, it's giving documentation. πŸ“š


πŸ‘€ 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.

⚠️ yes this is the real license text and yes you have to keep it. don't touch it, don't paraphrase it, don't vibe-edit it. it's load-bearing. πŸ’€

πŸ”– NOTES πŸ”–

the footnote kind, not the tea-spilling kind:

  1. OpenCL Specification β€” page 264, section 6.12.6 - Relational Functions πŸ“–

that's the whole page bestie!! πŸŽ‰ every option, every return value, every NaN rule, untouched, just narrated with love. mwah. πŸ’‹

The Khronos Group Β· 01/14/2021 Β· ISLESSEQUAL(3clc) β€” that's a wrap, slay, periodt. πŸ’…βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from