ISINF(3clc)
✨ ISINF — it's giving "is this a vibe or is this infinity" ✨
okay bestie, welcome to ISINF(3clc), from the OpenCL Manual 💖 this is the little function that looks at a float and goes "bestie… are you infinite?" no cap.
🌸 NAME 🌸
isinf — test for infinity value. yes that's the whole job. iconic behaviour honestly 👑
here's the whole squad of signatures, exactly as they come:
int isinf(float );
intn isinf(floatn );
int isinf(double );
longn isinf(doublen );
int isinf (half) // if half extension enabled
shortn isinf (halfn) // if half extension enabled
🦋 DESCRIPTION 🦋
it tests for an infinity value, and by infinity we mean positive or negative. both directions count, she's not picky 💅
💜 NOTES 💜
okay so here's the fine print, and it matters, so listen up:
- if an implementation extends this spec 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 a crime here, they're just existing 🫶
- the built-in relational functions get extended with
cl_khr_fp16(3clc)to include the appropriate versions of functions that takehalf, andhalf{2|3|4|8|16}as arguments and return values. so the half crew is fully invited to the function 💖 - and the return value tea, which is lowkey the most important part:
- 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
not me emphasising that vectortrueis-1and not1😭 that's the one everybody gets wrong, fr fr. write it down bestie 📝
⭐ SPECIFICATION ⭐
OpenCL Specification[1]
🔥 SEE ALSO 🔥
relationalFunctions(3clc)— go say hi to the whole family 💕
👑 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.
like, legally required to include that whole paragraph, so here it is in full, no edits, periodt 💅
🧚 NOTES 🧚
- OpenCL Specification page
264, section6.12.6 - Relational Functions
and that's the whole page bestie, you ate that 🍓💖
this was brought to you by The Khronos Group, dated 01/14/2021, filed under ISINF(3clc) — stay infinite, stay iconic, mwah 🫶✨
📦 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