ISNAN(3clc)

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

πŸ’– ISNAN β€” bestie edition πŸ’–

okay so this is isnan(3clc), straight out of the OpenCL Manual, and it's literally just "hey is this thing a NaN" and nothing else. short king. we respect it. 🫢


✨ NAME ✨

isnan β€” test for a NaN. that's it, that's the whole job. πŸ’…

and here's every single shape it comes in, bestie, no skipping:

int isnan(float );

intn isnan(floatn );

int isnan(double );

longn isnan(doublen );

int isnan (half)      // if half
extension enabled

shortn isnan (halfn)      // if half
extension enabled

🌸 DESCRIPTION 🌸

test for NaN. that's the entire description. iconic minimalism honestly. ✨


πŸŽ€ NOTES πŸŽ€

okay so real talk, there's some stuff you gotta know πŸ‘‘

if an implementation extends this spec to support IEEE-754 flags or exceptions, then all the built-in relational functions have to proceed without raising the invalid floating-point exception when one or more of the operands are NaNs. so like. no drama, no exception, just vibes. 🧚

the built-in relational functions get 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. (yes the {2|3|4|8|16} notation is giving very much "choose your own adventure" and that's on purpose, it's not a typo 🫢)

and the return-value tea β˜• β€” the function returns a 0 if the specified relation is false and a 1 if the specified relation is true for scalar argument types. but 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.

not me lowkey needing to scream this one: scalars get 1, vectors get - 1 with all bits set. do NOT mix those up bestie, i'm begging 😭

πŸ’œ SPECIFICATION πŸ’œ

OpenCL Specification[1]


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHORS πŸ‘‘

The Khronos Group. (the literal main characters, no cap ⭐)


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 following conditions:

the above copyright notice and this 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, you ate it πŸ’… this one came from The Khronos Group and it's dated 01/14/2021 β€” go forth and detect your NaNs, you've got this πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from