54 auto dot(X &&x, Y &&y) {
56 static constexpr auto L_adr_spc = mem::get_addr_space<X>;
57 static constexpr auto R_adr_spc = mem::get_addr_space<Y>;
58 static_assert(L_adr_spc != mem::None);
59 static_assert(R_adr_spc != mem::None);
62 using value_t =
decltype(get_value_t<X>{} * get_value_t<Y>{});
63 using vector_t =
basic_array<value_t, 1,
C_layout,
'V', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
65 if constexpr (is_blas_lapack_v<value_t>) {
68 auto as_container = []<
typename A>(A
const &a) ->
decltype(
auto) {
69 if constexpr (is_regular_or_view_v<A>
and std::is_same_v<get_value_t<A>, value_t>)
75 return blas::dot(as_container(x), as_container(y));
78 return blas::dot_generic(x, y);
99 static constexpr auto L_adr_spc = mem::get_addr_space<X>;
100 static constexpr auto R_adr_spc = mem::get_addr_space<Y>;
101 static_assert(L_adr_spc != mem::None);
102 static_assert(R_adr_spc != mem::None);
105 using value_t =
decltype(get_value_t<X>{} * get_value_t<Y>{});
106 using vector_t =
basic_array<value_t, 1,
C_layout,
'V', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
108 if constexpr (is_blas_lapack_v<value_t>) {
111 auto as_container = []<
typename A>(A
const &a) ->
decltype(
auto) {
112 if constexpr (is_regular_or_view_v<A>
and std::is_same_v<get_value_t<A>, value_t>)
118 return blas::dotc(as_container(x), as_container(y));
121 return blas::dotc_generic(x, y);