ISNOTEQUAL(3clc)
π ISNOTEQUAL(3clc) π
okay bestie, welcome to the OpenCL Manual β this one's all about isnotequal, and ngl it's lowkey the most chaotic of the relational girlies. let's get into it β¨
πΈ NAME πΈ
isnotequal β the compare of x != y. that's it, that's the vibe. it literally just asks "are these two not the same?" and answers accordingly π
β¨ SYNOPSIS β¨
int isnotequal(float x, float y);
intn isnotequal(floatn x, floatn y);
int isnotequal(double x, double y);
longn isnotequal(doublen x, doublen y);
int isnotequal (half x, half y) // if
half extension enabled
shortn isnotequal (halfn x, halfn y)
// if half extension enabled
okay so notice the half ones have that little // if half extension enabled note β that's not optional garnish, bestie, those overloads only exist when the extension is on π
π¦ DESCRIPTION π¦
Returns the component-wise compare of x != y. periodt. every component gets checked, one by one, no skipping, no favorites π
π NOTES π
okay so a few things you need to know before you go off and use this, fr fr:
- 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 gonna cause a scene. iconic behaviour 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 where the half-flavored overloads up in the synopsis come from π§ - Here's the receipts on return values, and this part is highkey important:
- For scalar argument types: the function returns a
0if the specified relation is false and a1if the specified relation is true. - 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.
- For scalar argument types: the function returns a
- And now the NaN lore, because
isnotequalis the odd one out and I need you to know it π:- The relational functions
isequal,isgreater,isgreaterequal,isless,islessequal, andislessgreateralways return0if either argument is not a number (NaN). isnotequalreturns1if one or both arguments are not a number (NaN) and the argument type is a scalar.isnotequalreturns-1if one or both arguments are not a number (NaN) and the argument type is a vector.
- The relational functions
so yeah βisnotequalis literally the only one in the friend group that pops off when aNaNshows up. main character energy, 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 π source and version: The Khronos Group, dated 01/14/2021, filed under ISNOTEQUAL(3clc). go forth and compare, you ate πβ¨
π¦ 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