28 requires std::same_as<std::invoke_result_t<Function&&, uni20::host_write_mdspan_t<Mdspecs>&...>,
KernelAttempt>
34 auto mdspans = std::tuple{access.mdspan()...};
36 [&](
auto&... mdspan) ->
KernelAttempt {
return std::invoke(std::forward<Function>(function), mdspan...); },
46 using real_type = std::remove_cv_t<
decltype(recommended)>;
48 CHECK(recommended >= real_type{1}, recommended);
55 CHECK(recommended < maximum, recommended);
59 CHECK(recommended <= maximum, recommended);
62 blas_int
const result =
static_cast<blas_int
>(recommended);
63 CHECK(result >= 1, result);
64 CHECK(std::in_range<std::size_t>(result), result);
69constexpr std::optional<std::size_t>
try_size_product(std::size_t left, std::size_t right)
noexcept
RAII leases that resolve device descriptors and tensor views to mdspans.
Mutable mdspec metadata supporting host write acquisition.
Definition access.hpp:694
Concept for numeric scalar types (integer, real, or complex).
Definition scalar_concepts.hpp:81
constexpr T & real(detail::standard_complex< T > &z) noexcept
Provides mutable access to the real component of a uni20::complex value.
Definition math.hpp:173
constexpr bool isfinite(I const &x) noexcept
Returns whether an integer scalar is finite.
Definition math.hpp:121
Allocation-free runtime results for kernel backend attempts.
Scalar math helper utilities.
Definition linalg/backends/lapack/common.hpp:24
blas_int workspace_size(Scalar const &query)
Convert a provider workspace query result to the configured LAPACK integer type.
Definition linalg/backends/lapack/common.hpp:43
KernelAttempt with_host_write_mdspans(Function &&function, Mdspecs &... mdspecs)
Invoke a LAPACK attempt with host-writable mdspans under simultaneous leases.
Definition linalg/backends/lapack/common.hpp:29
constexpr std::optional< std::size_t > try_size_product(std::size_t left, std::size_t right) noexcept
Multiply allocation extents without wrapping std::size_t.
Definition linalg/backends/lapack/common.hpp:69
KernelAttempt
Result of one runtime kernel backend attempt.
Definition kernel_attempt.hpp:27
auto acquire_host_write_access_sync(Mdspan &mdspan)
Acquire a directly host-accessible writable mdspan.
Definition access.hpp:626
Project-level numeric limits customization point.
Definition numeric_limits.hpp:16
#define CHECK(cond,...)
Definition trace.hpp:299