ISNOTEQUAL(3clc)

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

πŸ’– 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 take half, and half{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 0 if the specified relation is false and a 1 if the specified relation is true.
    • 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.
  • And now the NaN lore, because isnotequal is the odd one out and I need you to know it πŸ‘‘:
    • The relational functions isequal, isgreater, isgreaterequal, isless, islessequal, and islessgreater always return 0 if either argument is not a number (NaN).
    • isnotequal returns 1 if one or both arguments are not a number (NaN) and the argument type is a scalar.
    • isnotequal returns -1 if one or both arguments are not a number (NaN) and the argument type is a vector.
so yeah β€” isnotequal is literally the only one in the friend group that pops off when a NaN shows up. main character energy, no cap 😭

⭐ SPECIFICATION ⭐

OpenCL Specification[1]


🫢 SEE ALSO 🫢

relationalFunctions(3clc)


πŸ’œ 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 πŸ’– 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