|
TDLS 0.4.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_FORCE_INLINE_GPU constexpr T | tdls::detail::abs (const T x) noexcept |
| Absolute value usable in constant expressions. | |
| TDLS_HOST_DEVICE TDLS_FORCE_INLINE_GPU constexpr int | tdls::detail::runtime_dimension (int v) noexcept |
| A dimension hidden from the optimizer of nvcc when it compiles device code for Blackwell (sm_100 and later), the identity elsewhere. | |
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 |
|
constexprnoexcept |
A dimension hidden from the optimizer of nvcc when it compiles device code for Blackwell (sm_100 and later), the identity elsewhere.
nvcc miscompiles TiledLUppSolverDynamic for these targets when a dimension passed by the caller is a compile-time constant and propagates into its loops (TDLS issue #16). Every entry point of that solver passes its dimensions through this function first, so that the solver is compiled for a runtime dimension, as it is meant to be. The runtime solvers of CooperativeLUpp and ArrowheadLUpp were found correct; ArrowheadLUpp reaches TiledLUpp through these entry points. nvc++ compiles the solver correctly for these targets (checked with -stdpar=gpu for cc120), so the statement is limited to nvcc. The empty assembly statement costs no instruction.
| [in] | v | dimension |