ISGREATER(3clc)
π 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 takehalf, andhalf{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
0if the specified relation is false and a1if the specified relation is true. clean. simple. princess treatment π - For vector argument types: these functions shall return a
0if the specified relation is false and a- 1(i.e. all bits set) if the specified relation is true. yeah, not1, nottrue, 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, andislessgreateralways return0if either argument is not a number (NaN). - but
isnotequal? she's the exception, main character energy only π she returns1if one or both arguments are not a number (NaN) and the argument type is a scalar, and returns-1if 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 you0, andisnotequalgives you1or-1depending on scalar vs vector. periodt.
π SPECIFICATION π
OpenCL Specification[1]
π₯ SEE ALSO π₯
relationalFunctions(3clc)β the whole friend group, go meet them π
π«Ά 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 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
- 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