1#ifndef TDLS_SOLVERS_OPTIONS_HPP
2#define TDLS_SOLVERS_OPTIONS_HPP
40#if defined(TDLS_DETAIL_SIDE_DISPATCH)
83template<
typename T,
bool gpu>
86 return sizeof(T) <= 4 ? n <= 14 : n <= 10;
88 return sizeof(T) <= 4 ? n <= 8 : n <= 12;
98 return physical_rows_fit_on<T, TDLS_TARGET_GPU != 0>(n);
108template<
typename T,
bool gpu>
110 const int n)
noexcept {
111 return r == RowInterchange::Physical ||
112 (r == RowInterchange::Auto && physical_rows_fit_on<T, gpu>(n));
123 const int n)
noexcept {
124 return physical_rows_on<T, TDLS_TARGET_GPU != 0>(r, n);
127#if defined(TDLS_DETAIL_SIDE_DISPATCH)
134 NV_IF_TARGET(NV_IS_DEVICE, (
return true;), (
return false;))
148 const int n)
noexcept {
149#if defined(TDLS_DETAIL_SIDE_DISPATCH)
150 if (!std::is_constant_evaluated())
151 return on_device_side() ? physical_rows_on<T, true>(r, n)
152 : physical_rows_on<T, false>(r, n);
154 return physical_rows<T>(r, n);
194 "tdls: a compile-time stride must be tdls::dynamic_stride or positive");
Toolchain detection and portability macros.
#define TDLS_FORCE_INLINE_ALL
Inlining forced on every backend, CPU included: TDLS_FORCE_INLINE_GPU on GPU, __forceinline under MSV...
Definition macros.hpp:101
#define TDLS_HOST_DEVICE
__host__ __device__ under CUDA, the equivalent attributes under HIP, empty elsewhere.
Definition macros.hpp:50
TDLS_HOST_DEVICE constexpr bool physical_rows_fit(const int n) noexcept
physical_rows_fit_on for the hardware of this compilation pass (TDLS_TARGET_GPU).
Definition options.hpp:97
TDLS_HOST_DEVICE constexpr bool physical_rows_fit_on(const int n) noexcept
Whether a matrix of n unknowns is small enough for the physical row interchanges on the given hardwar...
Definition options.hpp:84
RowInterchange
Row interchanges of a factorization with partial pivoting.
Definition options.hpp:59
@ Logical
Rows never move: the position of each row in the pivoted order is tracked.
Schedule
Elimination schedule of a factorization.
Definition options.hpp:51
@ RightLooking
Factor the diagonal block, push updates into the trailing matrix.
@ LeftLooking
Pull updates from prior blocks when a block is visited.
MatrixLayout
Memory layout of a dense matrix.
Definition options.hpp:213
@ ColMajor
Element (r, c) at flat index c * N + r.
@ RowMajor
Element (r, c) at flat index r * N + c, the TFEL convention.
TDLS_HOST_DEVICE constexpr bool physical_rows_on(const RowInterchange r, const int n) noexcept
Whether a factorization of n unknowns interchanges its rows physically on the given hardware,...
Definition options.hpp:109
constexpr bool any_static_stride
Whether one of the strides of an entry point is known at compile time: the entry point then runs its ...
Definition options.hpp:206
TDLS_HOST_DEVICE constexpr bool physical_rows_here(const RowInterchange r, const int n) noexcept
Whether a factorization of n unknowns interchanges its rows physically, decided at run time on the si...
Definition options.hpp:147
TDLS_HOST_DEVICE constexpr bool physical_rows(const RowInterchange r, const int n) noexcept
physical_rows_on for the hardware of this compilation pass (TDLS_TARGET_GPU).
Definition options.hpp:122
TDLS_HOST_DEVICE TDLS_FORCE_INLINE_ALL constexpr int stride_or(const int runtime) noexcept
The stride an entry point uses: the compile-time stride when it is known, the runtime one otherwise (...
Definition options.hpp:192
constexpr int dynamic_stride
The compile-time stride of an operand whose stride is known at run time only: the default of the stri...
Definition options.hpp:181
Detection of the compiler, of the language and of the side of the compilation pass: the one place whe...