Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
mdspan_matrix.hpp File Reference

Lower mdspan matrix views to provider-ready BLAS operands. More...

#include <uni20/backend/backend.hpp>
#include <uni20/backend/blas/blas_int.hpp>
#include <uni20/core/scalar_concepts.hpp>
#include <uni20/linalg/blas/blas_matrix.hpp>
#include <uni20/linalg/blas/mdspan_access.hpp>
#include <optional>
#include <type_traits>
#include <utility>
Include dependency graph for mdspan_matrix.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uni20::linalg::blas::MdspanMatrixMetadata
 Handle-independent matrix metadata used for BLAS eligibility checks. More...
 
struct  uni20::linalg::blas::MdspanMatrixStage< Scalar, Handle >
 Logical mdspan matrix layout before provider-specific BLAS lowering. More...
 

Namespaces

namespace  uni20
 
namespace  uni20::linalg
 
namespace  uni20::linalg::blas
 

Functions

template<class Scalar , class Handle >
constexpr auto uni20::linalg::blas::blas_readable_matrix (MdspanMatrixStage< Scalar, Handle > const &stage) -> BlasReadableMatrix< Scalar, Handle >
 Return the provider-ready readable operand for a staged mdspan matrix.
 
template<class Scalar , class Handle >
constexpr auto uni20::linalg::blas::blas_writable_matrix (MdspanMatrixStage< Scalar, Handle > const &stage) -> BlasWritableMatrix< Scalar, Handle >
 Return the provider-ready writable operand for a staged mdspan matrix.
 
constexpr MatrixTransform uni20::linalg::blas::storage_transform (MdspanMatrixMetadata const &metadata)
 Transform from the provider matrix shape to the logical mdspan shape.
 
template<class Scalar , class Handle >
constexpr MatrixTransform uni20::linalg::blas::storage_transform (MdspanMatrixStage< Scalar, Handle > const &stage)
 Transform from the provider matrix shape to the logical mdspan shape.
 
template<class Mdspan >
requires detail::blas_readable_mdspan<Mdspan, 2>
auto uni20::linalg::blas::try_blas_readable_matrix (Mdspan const &span) -> std::optional< BlasReadableMatrix< std::remove_cv_t< typename Mdspan::element_type >, typename Mdspan::data_handle_type > >
 Try to lower an mdspan directly to a readable provider operand.
 
template<class Mdspan >
requires detail::blas_writable_mdspan<Mdspan, 2>
auto uni20::linalg::blas::try_blas_writable_matrix (Mdspan const &span) -> std::optional< BlasWritableMatrix< std::remove_cv_t< typename Mdspan::element_type >, typename Mdspan::data_handle_type > >
 Try to lower a mutable mdspan directly to a writable provider operand.
 
template<detail::lapack_writable_mdspan Mdspan>
auto uni20::linalg::blas::try_lapack_writable_matrix (Mdspan const &span) -> std::optional< BlasWritableMatrix< std::remove_cv_t< typename Mdspan::element_type >, typename Mdspan::data_handle_type > >
 Try to lower an mdspan to the strict column-major shape expected by LAPACK.
 
template<uni20::RankedStridedMdspecLike< 2 > Mdspan>
auto uni20::linalg::blas::try_mdspan_matrix_metadata (Mdspan const &span) -> std::optional< MdspanMatrixMetadata >
 Inspect matrix layout and accessor semantics without resolving a data handle.
 
template<uni20::RankedStridedMdspecLike< 2 > Mdspan>
auto uni20::linalg::blas::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.
 

Detailed Description

Lower mdspan matrix views to provider-ready BLAS operands.