ISGREATER(3clc)

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

πŸ’– ISGREATER(3clc) β€” the OpenCL manual, but make it make sense πŸ’–

okay bestie, so this is a page from the OpenCL Manual, and today's main character is isgreater πŸŽ€ she's a relational function and she is so simple, but there's lore, so sit down, hydrate, and let's go 🧚


✨ NAME ✨

isgreater β€” literally just comparing x > y. that's it. that's the whole job πŸ’…


🌸 SYNOPSIS 🌸

int isgreater(float x, float y);

intn isgreater(floatn x, floatn y);

int isgreater(double x, double y);

longn isgreater(doublen x, doublen y);

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

so yeah, she comes in scalar and vector flavors, in float, double, and β€” only if the half extension is enabled, don't @ me β€” half πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

Returns the component-wise compare of x > y. 🫢

like, per component. every lane gets its own little vibe check against its partner. no cap.


πŸ‘‘ NOTES πŸ‘‘

okay this is the part where it gets real, stay with me:

  • 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 walk in and nobody screams. iconic behavior honestly πŸ’€
  • 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. that's the half-extension pipeline, bestie 🌸
  • 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. princess treatment πŸ‘‘
  • For vector argument types: these functions shall return a 0 if the specified relation is false and a - 1 (i.e. all bits set) if the specified relation is true. yeah, not 1, not true, it's all bits set. that's the vector girlies' way πŸŽ€
  • and the group chat rules, listen up πŸ“’ β€” the relational functions isequal, isgreater, isgreaterequal, isless, islessequal, and islessgreater always return 0 if either argument is not a number (NaN).
  • but isnotequal? she's the exception, main character energy only 😭 she 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.
fr fr, if you only remember one thing: NaN in β†’ those six functions give you 0, and isnotequal gives you 1 or -1 depending on scalar vs vector. periodt.

πŸ“œ 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 264, section 6.12.6 - Relational Functions

and that's the whole page, bestie πŸ¦‹ this was The Khronos Group's OpenCL manual, dated 01/14/2021, page ISGREATER(3clc) β€” mwah, slay, go compare some numbers πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from