Toggle table of contents sidebar
Mathematical constants¶Defined in header <Kokkos_MathematicalConstants.hpp>
which is included from <Kokkos_Core.hpp>
Provides all mathematical constants from <numbers>
(since C++20).
All constants are defined in the Kokkos::numbers::
namespace since version 4.0, in Kokkos::Experimental
in previous versions.
Mathematical constants
e
log2e
log10e
pi
inv_pi
inv_sqrtpi
ln2
ln10
sqrt2
sqrt3
inv_sqrt3
egamma
phi
The mathematical constants are available in Kokkos::Experimental::
since Kokkos 3.6
They were “promoted” to the Kokkos::numbers
namespace in 4.0 and removed from Kokkos::Experimental::
in 4.3
Passing mathematical constants by reference or taking their address in device code is not supported by some toolchains and hence not portable. (See known issues)
Support for quadruple precision floating-point __float128
can be enabled via -DKokkos_ENABLE_LIBQUADMATH=ON
.
KOKKOS_FUNCTION void example() { constexpr auto pi = Kokkos::numbers::pi_v<float>; auto const x = Kokkos::sin(pi/6); }See also¶
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4