ISNAN(3clc)
π 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 get1, vectors get- 1with 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 π
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 π
OpenCL Specificationpage 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
- 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