53 template <BlasArray<1> X, BlasArrayFor<X, 1> Y, BlasArrayFor<X, 2> A>
56 if constexpr (has_C_layout<A>) {
62 auto const [m, n] = a.shape();
63 EXPECTS(m == x.size());
64 EXPECTS(n == y.size());
67 EXPECTS(a.indexmap().min_stride() == 1);
70 if constexpr (mem::have_device_compatible_addr_space<X, Y, A>) {
71 device::ger(m, n, alpha, x.data(), x.indexmap().strides()[0], y.data(), y.indexmap().strides()[0], a.data(),
get_ld(a));
73 f77::ger(m, n, alpha, x.data(), x.indexmap().strides()[0], y.data(), y.indexmap().strides()[0], a.data(),
get_ld(a));
99 template <BlasArray<1> X, BlasArrayFor<X, 1> Y, BlasArrayFor<X, 2> A>
100 requires(has_F_layout<A>)
103 auto const [m, n] = a.shape();
104 EXPECTS(m == x.size());
105 EXPECTS(n == y.size());
108 EXPECTS(a.indexmap().min_stride() == 1);
112 return ger(alpha, x, y, a);
113 }
else if constexpr (mem::have_device_compatible_addr_space<X, Y, A>) {
114 device::gerc(m, n, alpha, x.data(), x.indexmap().strides()[0], y.data(), y.indexmap().strides()[0], a.data(),
get_ld(a));
116 f77::gerc(m, n, alpha, x.data(), x.indexmap().strides()[0], y.data(), y.indexmap().strides()[0], a.data(),
get_ld(a));
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides a C++ interface for various BLAS routines.
Provides concepts for the nda library.
Provides GPU and non-GPU specific functionality.
auto transpose(A &&a)
Transpose the memory layout of an nda::MemoryArray or an nda::expr_call.
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.
void gerc(get_value_t< X > alpha, X const &x, Y const &y, A &&a)
Interface to the BLAS/cuBLAS gerc routine.
void ger(get_value_t< X > alpha, X const &x, Y const &y, A &&a)
Interface to the BLAS/cuBLAS ger and geru routine.
constexpr bool is_complex_v
Constexpr variable that is true if type T is a std::complex type.
Provides definitions of various layout policies.
Macros used in the nda library.
Provides type traits for the nda library.