31template <
class Mdspan>
32concept lapack_writable_vector_mdspan =
39template <uni20::RankedStr
idedMdspanLike<1> Mdspan>
44 using scalar_type = std::remove_cv_t<typename Mdspan::element_type>;
45 using handle_type =
typename Mdspan::data_handle_type;
47 auto const& mapping =
span.mapping();
48 if (!mapping.is_unique())
61 blas_int increment = 1;
73 .increment = increment,
74 .needs_conjugation = mdspan_needs_conjugation_v<Mdspan>};
79template <
class Scalar,
class Handle>
83 CHECK(!stage.needs_conjugation,
"writable BLAS vectors cannot discard accessor conjugation");
84 return {.data = stage.data, .size = stage.extent, .increment = stage.increment};
90template <
class Scalar,
class Handle>
94 CHECK(!stage.needs_conjugation,
"readable BLAS vectors cannot discard accessor conjugation");
95 return {.data = stage.data, .size = stage.extent, .increment = stage.increment};
99template <
class Mdspan>
100 requires detail::blas_writable_mdspan<Mdspan, 1>
106 if (!stage || stage->needs_conjugation)
114template <
class Mdspan>
115 requires detail::blas_readable_mdspan<Mdspan, 1>
121 if (!stage || stage->needs_conjugation)
129template <detail::lapack_writable_vector_mdspan Mdspan>
135 if (!stage || stage->increment != 1 || stage->needs_conjugation)
Safe conversion helpers for the configured signed BLAS integer ABI.
Provider-ready BLAS vector operands.
An mdspan-like type whose accessor is stdex::default_accessor.
Definition mdspan/concepts.hpp:501
Concept for scalar types with a configured dense LAPACK backend.
Definition scalar_concepts.hpp:147
A mutable strided mdspan-like type with a specified static rank.
Definition mdspan/concepts.hpp:532
Direct BLAS accessor eligibility for ranked mdspan operands.
constexpr blas_int try_blas_int(Value value) noexcept
Convert a non-negative integer to blas_int, or return the negative invalid sentinel.
Definition blas_int.hpp:28
constexpr bool is_valid_blas_int(blas_int value) noexcept
Return whether a non-throwing BLAS integer conversion succeeded.
Definition blas_int.hpp:25
auto try_blas_writable_vector(Mdspan const &span) -> std::optional< BlasWritableVector< std::remove_cv_t< typename Mdspan::element_type >, typename Mdspan::data_handle_type > >
Try to lower a mutable rank-one mdspan directly to a writable provider operand.
Definition mdspan_vector.hpp:101
constexpr auto blas_writable_vector(MdspanVectorStage< Scalar, Handle > const &stage) -> BlasWritableVector< Scalar, Handle >
Return the provider-ready writable operand for a staged mdspan vector.
Definition mdspan_vector.hpp:81
auto try_blas_readable_vector(Mdspan const &span) -> std::optional< BlasReadableVector< std::remove_cv_t< typename Mdspan::element_type >, typename Mdspan::data_handle_type > >
Try to lower a readable rank-one mdspan directly to a provider operand.
Definition mdspan_vector.hpp:116
auto try_mdspan_vector_stage(Mdspan const &span) -> std::optional< MdspanVectorStage< std::remove_cv_t< typename Mdspan::element_type >, typename Mdspan::data_handle_type > >
Build an mdspan vector staging descriptor when direct BLAS lowering is possible.
Definition mdspan_vector.hpp:40
constexpr auto blas_readable_vector(MdspanVectorStage< Scalar, Handle > const &stage) -> BlasReadableVector< Scalar, Handle >
Return the provider-ready readable storage operand for a staged mdspan vector.
Definition mdspan_vector.hpp:92
auto try_lapack_writable_vector(Mdspan const &span) -> std::optional< BlasWritableVector< std::remove_cv_t< typename Mdspan::element_type >, typename Mdspan::data_handle_type > >
Try to lower an mdspan to the contiguous writable vector shape expected by LAPACK.
Definition mdspan_vector.hpp:130
std::size_t span
Definition presentation.cpp:2017
Readable vector shape as seen by a BLAS provider.
Definition blas_vector.hpp:24
Writable vector shape as seen by a BLAS provider.
Definition blas_vector.hpp:16
Logical rank-one mdspan layout before provider-specific BLAS lowering.
Definition mdspan_vector.hpp:22
blas_int extent
Definition mdspan_vector.hpp:24
blas_int increment
Definition mdspan_vector.hpp:25
Handle data
Definition mdspan_vector.hpp:23
bool needs_conjugation
Definition mdspan_vector.hpp:26
Trait to extract the scalar type from a type T.
Definition scalar_traits.hpp:93
#define CHECK(cond,...)
Definition trace.hpp:299