FAST_LENGTH(3clc)
π 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.
floatnmeansfloat,float2,float3, orfloat4β anddoublenmeansdouble,double2,double3, ordouble4. 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)orfma(3clc). slay π«Ά
π SPECIFICATION π
OpenCL Specification[1]
π SEE ALSO π
πΈ 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 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 π)
- 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
- 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