FABS(3clc)

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

πŸ’– FABS β€” aka the fabs page from the OpenCL Manual ✨

okay bestie, sit down, hydrate, because we're talking about fabs from the OpenCL Manual and it's honestly so much cuter than it sounds πŸŽ€


🌸 NAME 🌸

fabs β€” computes the absolute value of a floating-point number. that's it. that's the whole job. iconic behavior fr fr πŸ’…

gentype fabs(gentype );

✨ DESCRIPTION ✨

fabs computes the absolute value of a floating-point number. like, if your number is negative, it comes back positive. glow-up arc, no cap πŸ¦‹


🧚 NOTES 🧚

okay so here's the tea, and it's important tea β˜•

  • The vector versions of the math functions operate component-wise. The description is per-component. so like, each lane does its own lil thing, independently, slay πŸ’«
  • The built-in math functions are not affected by the prevailing rounding mode in the calling environment, and they always return the same value as they would if called with the round to nearest even rounding mode. so no matter what chaos your environment is in, these functions keep it consistent. stable queen πŸ‘‘
  • The built-in math functions take scalar or vector arguments. For any specific use of these functions, the actual type has to be the same for all arguments and the return type unless otherwise specified. no mixing and matching, bestie, we're not doing that here πŸ™ˆ
  • The generic type name gentype is used to indicate that the function can take float, float2, float3, float4, float8, float16, double, double2, double3, double4, double8, or double16 as the type for the arguments. that's a whole roster and every single one of them is valid πŸ’–
  • If extended with cl_khr_fp16(3clc), the generic type name gentype may indicate half and half{2|3|4|8|16} as arguments and return values. yes, half types get to come to the party too πŸŽ‰
  • The generic type name gentypef is used to indicate that the function can take float, float2, float3, float4, float8, or float16 as the type for the arguments. float-only club 🌸
  • The generic type name gentyped is used to indicate that the function can take double, double2, double3, double4, double8, or double16 as the type for the arguments. double-only club πŸ’œ

πŸ“œ SPECIFICATION πŸ“œ

OpenCL Specification[1] β€” go read it, it's giving authoritative ✨


πŸ‘€ SEE ALSO πŸ‘€

  • mathFunctions(3clc) β€” the whole math functions family, your new hyperfixation fr fr 🫢

πŸ‘‘ AUTHORS πŸ‘‘

The Khronos Group. yes, THE Khronos Group. main character energy, honestly πŸ†


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: it's free, use it, just keep the notice in there. respect the og πŸ’–)


πŸ“ NOTES (the numbered one, not the other one, yes there are two, don't @ me) πŸ“

  1. OpenCL Specification β€” page 244, section 6.12.2 - Math Functions. that's your page number, bestie, memorize it πŸ“–βœ¨

and that's the whole page!! πŸ’œ

<cute sign-off time> this lil masterpiece was brought to you by The Khronos Group, dated 01/14/2021, and it lives in the FABS(3clc) section of the OpenCL manual. stan a stable API. periodt πŸ’…πŸŒˆβœ¨

πŸ“¦ where this page comes from