FAST_LENGTH(3clc)

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

πŸ’– FAST_LENGTH πŸ’–

okay bestie, welcome to FAST_LENGTH from the OpenCL Manual (that's the 3clc section, iykyk) β€” it's giving "how long is this vector actually" and honestly? iconic.


✨ NAME ✨

fast_length β€” literally the length of a vector. that's it, that's the whole job πŸ’…

float fast_length(floatn p);

πŸ¦‹ DESCRIPTION πŸ¦‹

so you hand it a vector p and it hands you back the length, computed like this:

sqrt(3clc)(p.x2 + p.y2 + ...)

no cap, that's the formula. πŸŽ€


πŸ“ NOTES πŸ“

  • Built-in geometric functions operate component-wise. The description is per-component. periodt.
  • floatn means float, float2, float3, or float4 β€” and doublen means double, double2, double3, or double4. collect them all πŸ’–
  • The built-in geometric functions are implemented using the round to nearest even rounding mode. yes, that specific one, don't @ me.
  • The geometric functions can be implemented using contractions such as mad(3clc) or fma(3clc). slay 🫢

🌈 SPECIFICATION 🌈

OpenCL Specification[1]


πŸ‘‘ SEE ALSO πŸ‘‘

geometricFunctions(3clc)


🌸 AUTHORS 🌸

The Khronos Group


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.

fr fr, that's the whole legal bit, don't skip it bestie, lawyers are watching πŸ‘€

πŸ“ NOTES πŸ“ (the sequel πŸ“)

  1. OpenCL Specification β€” page 262, section 6.12.5 - Geometric Functions

and that's the vibe check complete πŸ’œ this lil page came from The Khronos Group, dated 01/14/2021, living its best life as FAST_LENGTH(3clc). go forth and measure ur vectors, main character πŸ’…βœ¨

πŸ“¦ where this page comes from