Skip to content

Commit

Permalink
dot, dotc: add customization points and tests kokkos#96
Browse files Browse the repository at this point in the history
  • Loading branch information
fnrizzi committed Oct 26, 2021
1 parent b2faf60 commit 0848a8c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
30 changes: 0 additions & 30 deletions examples/kokkos-based/dot_kokkos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

int main(int argc, char* argv[])
{
<<<<<<< HEAD
std::cout << "dot example: calling kokkos-kernels" << std::endl;

std::size_t N = 50;
Expand All @@ -22,28 +21,11 @@ int main(int argc, char* argv[])
mdspan_type a(a_ptr,N);
mdspan_type b(b_ptr,N);
for(std::size_t i=0; i<a.extent(0); i++){
=======
std::cout << "running dot example calling custom kokkos" << std::endl;
int N = 50;
Kokkos::initialize(argc,argv);
{
Kokkos::View<double*> a_view("A",N);
Kokkos::View<double*> b_view("B",N);
double* a_ptr = a_view.data();
double* b_ptr = b_view.data();

using dyn_1d_ext_type = std::experimental::extents<std::experimental::dynamic_extent>;
using mdspan_type = std::experimental::mdspan<double, dyn_1d_ext_type>;
mdspan_type a(a_ptr,N);
mdspan_type b(b_ptr,N);
for(int i=0; i<a.extent(0); i++){
>>>>>>> dot: customization point to Kokkos-kernels and example
a(i) = i;
b(i) = i;
}

namespace stdla = std::experimental::linalg;
<<<<<<< HEAD
const value_type init_value(2.0);

// This goes to the base implementation
Expand All @@ -53,18 +35,6 @@ int main(int argc, char* argv[])
// This forwards to KokkosKernels
const auto res_kk = stdla::dot(KokkosKernelsSTD::kokkos_exec<>(), a, b, init_value);
printf("Kokkos result = %lf\n", res_kk);
=======
const double init_value = 2.0;

// This goes to the base implementation
const auto res_seq = stdla::dot(std::execution::seq, a, b, init_value);

// This forwards to KokkosKernels
auto res_kk = stdla::dot(KokkosKernelsSTD::kokkos_exec<>(), a, b, init_value);

printf("Kokkos result = %lf\n", res_kk);
printf("Seq result = %lf\n", res_seq);
>>>>>>> dot: customization point to Kokkos-kernels and example
}
Kokkos::finalize();
}
6 changes: 0 additions & 6 deletions include/experimental/__p1673_bits/blas1_dot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ struct is_custom_dot_avail<

} // end anonymous namespace


// ------------
// PUBLIC API:
// ------------

// dot, with init value
template<class ExecutionPolicy,
class ElementType1,
extents<>::size_type ext1,
Expand Down

0 comments on commit 0848a8c

Please sign in to comment.