EXP(3clc)
π EXP, EXP2, EXP10, EX β the OpenCL Manual page (3clc) π
okay bestie, buckle up, we're doing exponent functions today β¨ this is the EXP(3clc) page from the OpenCL Manual and it's genuinely so much, let's go π«Ά
β¨ NAME β¨
exp, _exp2, _exp10, _expm1_ (including _half__ and _native_) β Exponent functions. π
gentype exp(gentype x);
gentype exp2(gentype );
gentype exp10(gentype );
gentype expm1(gentype x);
gentype half_exp(gentype x);
gentype half_exp2(gentype x);
gentype half_exp10(gentype x);
gentype native_exp(gentype x);
gentype native_exp2(gentype x);
gentype native_exp10(gentype x);
πΈ DESCRIPTION πΈ
no cap, here's the whole roster π
expcomputes the base-eexponential ofx. π§exp2is the exponential base 2 function. π¦exp10is the exponential base 10 function. πexpm1computesex - 1.0. πhalf_expcomputes the base-eexponential ofx.half_exp2computes the base-2exponential ofx.half_exp10computes the base-10exponential ofx.native_expcomputes the base-eexponential ofxover an implementation-defined range. The maximum error is implementation-defined. πnative_exp2computes the base-2exponential ofxover an implementation-defined range. The maximum error is implementation-defined. πnative_exp10computes the base-10exponential ofxover an implementation-defined range. The maximum error is implementation-defined. π
π 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. (yes girl, every single lane of your vector, individually β¨)
- The built-in math functions are not affected by the prevailing rounding mode in the calling environment, and always return the same value as they would if called with the round to nearest even rounding mode. it's giving consistent. it's giving reliable. π
- The built-in math functions take scalar or vector arguments. For any specific use of these function, the actual type has to be the same for all arguments and the return type unless otherwise specified. π₯
- The generic type name
gentypeis used to indicate that the function can takefloat,float2,float3,float4,float8,float16,double,double2,double3,double4,double8, ordouble16as the type for the arguments. π - If extended with
cl_khr_fp16(3clc), generic type namegentypemay indicatehalfandhalf{2|3|4|8|16}as arguments and return values. π - The generic type name
gentypefis used to indicate that the function can takefloat,float2,float3,float4,float8, orfloat16as the type for the arguments. β - The generic type name
gentypedis used to indicate that the function can takedouble,double2,double3,double4,double8, ordouble16as the type for the arguments. β - Functions with the
half_prefix are implemented with a minimum of 10-bits of accuracy i.e. an ULP value less than or equal to 8192 ulp. π«Ά - Functions with the
native_prefix may map to one or more native device instructions and will typically have better performance compared to the corresponding functions (without thenative_prefix). The accuracy (and in some cases the input range(s)) of these functions is implementation-defined. π
bestie, read that last one twice. native_ is the fast-and-loose bestie. she's fast, she's fun, but her accuracy and even her valid input ranges are up to whoever implemented her. not a bug, just the vibe check. π
π 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 condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.
β NOTES (the footnotes, not the other notes, i know, iconic) β
- OpenCL Specification page 244, section 6.12.2 - Math Functions
and that's the whole page bestie, you ate it π β¨ this one came from The Khronos Group, dated 01/14/2021 β go forth and exponentiate responsibly π«ΆπΈπ
π¦ 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