-
Notifications
You must be signed in to change notification settings - Fork 98
BLAS 1::team dot
Nathan Ellingwood edited this page Nov 12, 2019
·
1 revision
Header File: KokkosBlas1_team_dot.hpp
Usage: result = KokkosBlas::Experimental::dot(team,x,y);
Multiplies each value of x(i)
with y(i)
and computes the total within a parallel kernel using a TeamPolicy
execution policy
template <class TeamType, class XVector, class YVector>
typename Kokkos::Details::InnerProductSpaceTraits<typename XVector::non_const_value_type>::dot_type
KOKKOS_INLINE_FUNCTION dot (const TeamType& team, const XVector& x, const YVector& y)
- TeamType: A
Kokkos::TeamPolicy<...>::member_type
- VectorX: A rank-1
Kokkos::View
- VectorY: A rank-1
Kokkos::View
-
Y.rank == 1
orX.rank == 1
Y.extent(0) == X.extent(0)
#include<Kokkos_Core.hpp>
#include<KokkosBlas1_team_dot.hpp>
int main(int argc, char* argv[]) {
Kokkos::initialize();
int N = atoi(argv[1]);
Kokkos::View<double*> x("X",N);
Kokkos::View<double*> y("Y",N);
Kokkos::deep_copy(x,3.0);
Kokkos::deep_copy(y,2.0);
using policy = Kokkos::TeamPolicy<>;
using member_type = typename policy::member_type;
Kokkos::parallel_for("TeamDotDemoUsage", policy(1, Kokkos::AUTO), KOKKOS_LAMBDA (const member_type& team) {
double result = KokkosBlas::Experimental::dot(team, x, y);
});
Kokkos::finalize();
}