31namespace nda::lapack {
65 template <BlasArray<3> A, BlasArrayFor<A, 2> TAU, BlasArrayFor<A, 1> W = vector_value_t<A>>
69 auto const [m, n, n_b] = a.shape();
73 EXPECTS(a.indexmap().min_stride() == 1);
74 EXPECTS(tau.indexmap().min_stride() == 1);
76#if defined(__has_feature)
77#if __has_feature(memory_sanitizer)
89 blas::device::geqrf_batch(m, n, a_ptrs.data(),
get_ld(a(range::all, range::all, 0)), tau_ptrs.data(), info, n_b);
92 for (
int i = 0; i < n_b; ++i) {
93 auto a_i = a(range::all, range::all, i);
94 auto tau_i = tau(range::all, i);
95 int local_info =
geqrf(a_i, tau_i, work);
96 if (local_info != 0 && info == 0) info = local_info;
109 template <BlasArray<3> A, BlasArrayFor<A, 2> TAU, BlasArrayFor<A, 1> W = vector_value_t<A>>
112 return geqrf_batch(std::forward<A>(a), std::forward<TAU>(tau), std::forward<W>(work));
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides the generic class for arrays.
Provides basic functions to create and manipulate arrays and views.
Provides a C++ interface for various BLAS routines.
Provides concepts for the nda library.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
Provides GPU and non-GPU specific functionality.
Provides a generic interface to the LAPACK/cuSOLVER geqrf routine.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
decltype(auto) to_device(A &&a)
Convert an nda::MemoryArray to its regular type on device memory.
std::decay_t< decltype(get_first_element(std::declval< A const >()))> get_value_t
Get the value type of an array/view or a scalar type.
int get_ld(A const &a)
Get the leading dimension of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
auto batch_ptrs(A &&a)
Given a 2- or 3-dimensional array get an array of pointers to each of the submatrices/subvectors inde...
vector< get_value_t< A >, heap< mem::get_addr_space< A > > > vector_value_t
Alias for an nda::vector with the same value type and address space as the given type.
static constexpr bool has_F_layout
Constexpr variable that is true if all given nda::Array types have nda::F_layout.
int geqrf(A &&a, TAU &&tau, W &&work=vector_value_t< A >{})
Interface to the LAPACK/cuSOLVER geqrf routine.
int geqrf_batch(A &&a, TAU &&tau, W &&work=vector_value_t< A >{})
Interface to batched versions of the LAPACK/cuSOLVER geqrf routine.
static constexpr bool have_device_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Device.
Provides a C++ interface for various LAPACK routines.
Macros used in the nda library.
Provides type traits for the nda library.