53 template <BlasArray<1> X, BlasArrayFor<X, 1> Y, BlasArrayFor<X, 2> 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);
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>
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);
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.
static constexpr bool has_C_layout
Constexpr variable that is true if all given nda::Array types have nda::C_layout.
static constexpr bool has_F_layout
Constexpr variable that is true if all given nda::Array types have nda::F_layout.
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.
static constexpr bool have_device_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Device.
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.