ISNORMAL(3clc)

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

πŸ’– ISNORMAL(3clc) β€” the OpenCL Manual, bestie edition πŸ’–

okay so. you're deep in the OpenCL manual (yes, that manual) and you've stumbled into isnormal from 3clc, and honestly? it's giving "small function, big vibes." let's get into it πŸ¦‹


✨ NAME ✨

isnormal β€” Test for a normal value. that's it. that's the whole job. she's a vibe checker for your floats πŸ’…

and because OpenCL loves a glow-up, she comes in several flavors:

int isnormal(float );

intn isnormal(floatn );

int isnormal(double );

longn isnormal(doublen );

int isnormal (half)      // if half
extension enabled

shortn isnormal (halfn)      // if half
extension enabled

like yes, she does scalars, she does vectors, she does half if the half extension is enabled. versatile queen πŸ‘‘


🌸 DESCRIPTION 🌸

Test for a normal value. that's the official description and honestly it's serving brevity. no cap, that's literally the whole thing πŸ’€


πŸŽ€ NOTES πŸŽ€

okay here's the part where you actually need to pay attention, bestie, because this is the technical tea β˜•

  • 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. like, NaNs are welcome here, she's not gonna scream about it πŸ™ˆ
  • 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. so yeah, half-precision girlies, you're included 🫢
  • The function returns a 0 if the specified relation is false and a 1 if the specified relation is true for scalar argument types. 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. ⚠️ yes this is a real gotcha β€” scalars get 1, vectors get - 1 with all bits set. do NOT mix those up, i'm begging 😭

πŸ’œ SPECIFICATION πŸ’œ

OpenCL Specification[1] β€” she's official, she's cited, she's in the building πŸ’…


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHORS πŸ‘‘

The Khronos Group. icons only. periodt.


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.

(translation: use it, remix it, ship it, just keep the receipt 🧾)


πŸ“ NOTES (the footnote kind, not the section kind) πŸ“

  1. OpenCL Specification page 264, section 6.12.6 - Relational Functions

⚠️ friendly reminder: this page is about testing whether a value is normal β€” she is NOT here to make anything normal, no matter how much you beg. read the return values twice. vectors get - 1, not 1. iykyk πŸ’€

and that's the whole page, bestie!! no crumbs left behind ✨ this one came straight from The Khronos Group, dated 01/14/2021, page ISNORMAL(3clc) β€” go forth and check your normals responsibly πŸ¦‹πŸ’–

πŸ“¦ where this page comes from