|
TDLS 0.2.0
Tiny Device-callable Linear Solvers
|
Scalar math helpers usable in constant expressions. More...
Go to the source code of this file.
Functions | |
| template<typename T > | |
| TDLS_HOST_DEVICE TDLS_FORCEINLINE constexpr T | tdls::detail::abs (const T x) noexcept |
| Absolute value usable in constant expressions. | |
Scalar math helpers usable in constant expressions.
|
nodiscardconstexprnoexcept |
Absolute value usable in constant expressions.
std::fabs is not constexpr before C++23, so constant evaluation falls back to a ternary, indistinguishable from std::fabs in the magnitude comparisons of the solvers (signed zeros compare equal, NaNs propagate either way). At run time the function IS std::fabs: the naive ternary alone would forbid the single sign-bit instruction (it must preserve -0.0) and was measured 3% heavier in device code on the pivot search.
| T | scalar type |
| [in] | x | value |