30namespace lapack_detail
35 using scalar_type = std::remove_cv_t<typename MatrixMdspan::element_type>;
38 reduction_detail::output_is_supported<Output, result_type, 0>())
51 return transposed ?
'I' :
'1';
53 return transposed ?
'1' :
'I';
57 PANIC(
"invalid MatrixNorm", std::to_underlying(kind));
60template <
class Output, uni20::RankedStr
idedMdspanLike<2> MatrixMdspan>
63 using scalar_type = std::remove_cv_t<typename MatrixMdspan::element_type>;
77 if (provider.rows == 0 || provider.cols == 0)
84 result_type work_placeholder{};
85 std::vector<result_type> work;
88 work.resize(
static_cast<std::size_t
>(provider.rows));
90 result_type* work_data = work.empty() ? &work_placeholder : work.data();
94 auto* data =
const_cast<scalar_type*
>(provider.data);
95 result_type
const result =
104template <
class Output, uni20::RankedStr
idedMdspecLike<2> MatrixMdspec>
110 constexpr auto acceptance = lapack_detail::matrix_norm_acceptance<output_type, matrix_span>();
118template <
class Output, uni20::RankedStr
idedMdspecLike<2> MatrixMdspec>
123 auto matrix_span = matrix_access.mdspan();
RAII leases that resolve device descriptors and tensor views to mdspans.
Concept for complex scalar types.
Definition scalar_concepts.hpp:75
An mdspan-like type whose accessor is stdex::default_accessor.
Definition mdspan/concepts.hpp:501
Mdspec metadata supporting host read acquisition.
Definition access.hpp:688
Concept for scalar types with a configured dense LAPACK backend.
Definition scalar_concepts.hpp:147
Operation-tag backend dispatch over tensor-view operands.
typename make_real< T >::type make_real_t
Alias for the underlying real-valued type of T.
Definition scalar_traits.hpp:168
Checked LAPACK wrappers over provider-specific unchecked overloads.
Shared helpers for LAPACK operation-tag backend adapters.
Mdspan concept and accessor extensions for Uni20.
Lower mdspan matrix views to provider-ready BLAS operands.
Scalar lange(char norm, blas_int m, blas_int n, Scalar *a, blas_int lda, Scalar *work)
Compute a dense real matrix norm through the configured LAPACK backend.
Definition lapack.hpp:185
constexpr auto blas_writable_matrix(MdspanMatrixStage< Scalar, Handle > const &stage) -> BlasWritableMatrix< Scalar, Handle >
Return the provider-ready writable operand for a staged mdspan matrix.
Definition mdspan_matrix.hpp:225
auto try_mdspan_matrix_stage(Mdspan const &span) -> std::optional< MdspanMatrixStage< std::remove_cv_t< typename Mdspan::element_type >, detail::span_data_t< Mdspan > > >
Build a matrix staging descriptor when direct provider lowering is possible.
Definition mdspan_matrix.hpp:202
char lapack_matrix_norm(MatrixNorm kind, bool transposed)
Definition backends/lapack/matrix_norm.hpp:44
KernelAttempt try_matrix_norm(matrix_norm_op const &operation, Output &output, MatrixMdspan &matrix)
Definition backends/lapack/matrix_norm.hpp:61
consteval auto matrix_norm_acceptance()
Definition backends/lapack/matrix_norm.hpp:33
typename HostOutputType< Output >::type host_output_t
Resolved output type used by a host reduction backend probe.
Definition reduction_output.hpp:56
void write_host_output(Output &output, Scalar value)
Store a scalar in either a resolved rank-zero mdspan or C++ scalar.
Definition reduction_output.hpp:59
KernelAttempt with_host_output(Output &output, Function &&function)
Invoke a synchronous reduction with a resolved host output.
Definition reduction_output.hpp:68
Definition linalg/async.hpp:28
KernelAttempt try_kernel(BlasBackend, gemm_op const &, C &c, S const &alpha, A &a, B &b, S const &beta)
Pack logical host values and execute GEMM through value-preserving provider conversion.
Definition linalg/backends/blas/binary80.hpp:30
KernelAttempt
Result of one runtime kernel backend attempt.
Definition kernel_attempt.hpp:27
constexpr KernelAcceptance< KernelTypeAcceptance::no > kernel_types_no
Report that a backend rejects the argument types.
Definition dispatch_error.hpp:34
MatrixNorm
Matrix norm selected by matrix_norm_op.
Definition operation_tags.hpp:119
@ One
Induced one-norm: largest column sum of entry magnitudes.
@ MaxAbs
Largest entry magnitude, max_ij abs(A[i,j]).
@ Frobenius
Frobenius norm: square root of the sum of squared entry magnitudes.
@ Infinity
Induced infinity-norm: largest row sum of entry magnitudes.
consteval auto kernel_accepts_types(BlasBackend, gemm_op const &, C &, S const &, A &, B &, S const &)
Accept host-readable native binary80 operands, including transforming accessors.
Definition linalg/backends/blas/binary80.hpp:19
constexpr KernelAcceptance< KernelTypeAcceptance::maybe > kernel_types_maybe
Report that runtime operand values determine backend acceptance.
Definition dispatch_error.hpp:37
std::remove_cvref_t< decltype(std::declval< detail::host_read_mdspan_lease_t< Mdspec > & >().mdspan())> host_read_mdspan_t
Read-only mdspan type resolved by host descriptor acquisition.
Definition access.hpp:679
mpreal norm(mpcomplex const &z)
Definition mpcomplex.hpp:494
auto acquire_host_read_access_sync(Mdspan const &mdspan)
Acquire a directly host-accessible read-only mdspan.
Definition access.hpp:616
Shared host-output handling for synchronous scalar reductions.
Backend family for configured dense LAPACK kernels, including MPLAPACK scalar adapters.
Definition backend_selector.hpp:20
Dense rank-two matrix norm operation tag.
Definition operation_tags.hpp:135
Trait to extract the scalar type from a type T.
Definition scalar_traits.hpp:93
Concepts for tensor-level objects that resolve mdspan kernel operands.
#define PANIC(...)
Definition trace.hpp:382