SIN(3clc)

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

🌸 SIN, SINCOS, SINH, SINPI, HALF_SIN, NATIVE_SIN β€” the OpenCL Manual page πŸ’–

okay bestie, sit down, hydrate, because we're doing trigonometry today and honestly? it's giving iconic. this is the sin family page from the OpenCL Manual, and every single one of these babies is a sine function. periodt. ✨


πŸŽ€ NAME πŸŽ€

sin, _sincos, _sinh, _sinpi, _half_sin, _native_sin β€” Sine functions. 🌊

and here's the whole squad in their natural habitat, verbatim, no edits, no cap:

gentype sin(gentype );

gentype sincos(gentype x, __global gentype *cosval);

gentype sincos(gentype x, __local gentype *cosval);

gentype sincos(gentype x, __private gentype *cosval);

gentype sinh(gentype );

gentype sinpi(gentype x);

gentype half_sin(gentype x);

gentype native_sin(gentype x);

✨ DESCRIPTION ✨

okay so, function by function, let's get into it:

  • sin β€” computes the sine. that's it, that's the whole vibe. πŸ¦‹
  • sincos β€” computes sine AND cosine of x, because why do one when you can do both? the computed sine is the return value, and the computed cosine gets handed back to you through cosval. two for one, slay. πŸ’…
  • sinh β€” computes the hyperbolic sine. fancy cousin behavior. πŸ‘‘
  • sinpi β€” computes sin (pi * x). yes, pi is baked in, you don't gotta bring your own. πŸ₯§
  • half_sin β€” computes sine, but heads up bestie: x must be in the range -216... +216. that's the rule, don't test it. πŸ™ˆ
  • native_sin β€” computes sine over an implementation-defined range, and the maximum error is also implementation-defined. so like... your device decides. mysterious. πŸ”₯

πŸ’œ NOTES πŸ’œ

  • the vector versions of the math functions operate component-wise. the description is per-component, so think of it as the same little party happening in every lane. πŸŽ‰
  • built-in math functions are NOT affected by the prevailing rounding mode of the calling environment, and they always return the same value as they would if called with the round to nearest even rounding mode. consistent queen. πŸ‘‘
  • 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, bestie, it's a vibe check. ⭐
  • the generic type name gentype means the function can take float, float2, float3, float4, float8, float16, double, double2, double3, double4, double8, or double16 as the type for the arguments.
  • if extended with cl_khr_fp16(3clc), the generic type name gentype may also indicate half and half{2|3|4|8|16} as arguments and return values. 🧚
  • the generic type name gentypef means the function can take float, float2, float3, float4, float8, or float16 as the type for the arguments.
  • the generic type name gentyped means the function can take double, double2, double3, double4, double8, or double16 as 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 ≀ 8192 ulp. that's the fine print, fr fr. πŸ“
  • 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 the native__ prefix). but the accuracy (and in some cases the input range(s)) of these functions is implementation-defined. so: faster, but mysterious. choose wisely. πŸ”₯

🌈 SPECIFICATION 🌈

OpenCL Specification[1]


🫢 SEE ALSO 🫢

mathFunctions(3clc) β€” go read your sibling page, bestie, it's the whole family tree. 🌳


πŸ’– 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 condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.


πŸ’… NOTES (yes, a second NOTES section, we love a plot twist) πŸ’…

  1. OpenCL Specification β€” page 244, section 6.12.2 - Math Functions

okay that's the whole page, you ate it, I'm obsessed. πŸ“ this was SIN, SINCOS, SINH, S(3clc) from the OpenCL Manual, brought to you by The Khronos Group, dated 01/14/2021. go forth and compute your sines, my main character. periodt. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from