DOT(3clc)
β¨ DOT(3clc) β¨
okay bestie, welcome to dot from the OpenCL Manual π this one's a lil geometric function and she is so simple it's almost rude. let's get into it π¦
π NAME π
dot β Dot product. that's it. that's the whole job. π
float dot(floatn p0, floatn p1);
double dot(doublen p0, doublen p1);
half dot (gentype p0, gentype p1)
// if half extension enabled
look at her. three lil signatures, all vibes, no drama πΈ
π DESCRIPTION π
Computes the dot product. genuinely that is the entire description, she's lowkey iconic for how little she needs to say π
π NOTES π
okay so here's the tea, and it matters:
- The built-in geometric functions operate component-wise. The description is per-component. like, each lane does its own lil thing, no cap.
floatnisfloat,float2,float3, orfloat4β so pick your size bestie β¨doublenisdouble,double2,double3, ordouble4β same energy, more precision π- The built-in geometric functions are implemented using the round to nearest even rounding mode. yes, that one. the banker's rounding one. she's real and she's here.
- The geometric functions can be implemented using contractions such as
mad(3clc)orfma(3clc). so like, the compiler might fuse things. iykyk π₯ - If extended with
cl_khr_fp16(3clc), the generic type namegentypemay indicatehalfandhalf{2|3|4}as arguments. so when the half extension is enabled,gentypecan behalf,half2,half3, orhalf4π§
π SPECIFICATION π
OpenCL Specification[1] β she's official, she's certified, she's got receipts π«Ά
π SEE ALSO π
geometricFunctions(3clc)β go read the whole family, they're all slaying together π
π AUTHORS π
The Khronos Group. periodt. π
βοΈ 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.
yes bestie, i copy-pasted the legal text word for word. you do not freestyle a license. that's the one thing you never remix π
πΈ NOTES πΈ
- OpenCL Specification β page 262, section 6.12.5 - Geometric Functions. go look it up, it's giving authoritative β¨
and that's the whole page, angel π¦ this lil manual came from The Khronos Group and it's dated 01/14/2021 β the DOT(3clc) era, truly a moment. take care of her, she just multiplies and sums π bye bestie!! π
π¦ 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