Skip to content

Commit 0848a8c

Browse files
committed
dot, dotc: add customization points and tests kokkos#96
1 parent b2faf60 commit 0848a8c

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

Diff for: examples/kokkos-based/dot_kokkos.cpp

-30
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

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

109
std::size_t N = 50;
@@ -22,28 +21,11 @@ int main(int argc, char* argv[])
2221
mdspan_type a(a_ptr,N);
2322
mdspan_type b(b_ptr,N);
2423
for(std::size_t i=0; i<a.extent(0); i++){
25-
=======
26-
std::cout << "running dot example calling custom kokkos" << std::endl;
27-
int N = 50;
28-
Kokkos::initialize(argc,argv);
29-
{
30-
Kokkos::View<double*> a_view("A",N);
31-
Kokkos::View<double*> b_view("B",N);
32-
double* a_ptr = a_view.data();
33-
double* b_ptr = b_view.data();
34-
35-
using dyn_1d_ext_type = std::experimental::extents<std::experimental::dynamic_extent>;
36-
using mdspan_type = std::experimental::mdspan<double, dyn_1d_ext_type>;
37-
mdspan_type a(a_ptr,N);
38-
mdspan_type b(b_ptr,N);
39-
for(int i=0; i<a.extent(0); i++){
40-
>>>>>>> dot: customization point to Kokkos-kernels and example
4124
a(i) = i;
4225
b(i) = i;
4326
}
4427

4528
namespace stdla = std::experimental::linalg;
46-
<<<<<<< HEAD
4729
const value_type init_value(2.0);
4830

4931
// This goes to the base implementation
@@ -53,18 +35,6 @@ int main(int argc, char* argv[])
5335
// This forwards to KokkosKernels
5436
const auto res_kk = stdla::dot(KokkosKernelsSTD::kokkos_exec<>(), a, b, init_value);
5537
printf("Kokkos result = %lf\n", res_kk);
56-
=======
57-
const double init_value = 2.0;
58-
59-
// This goes to the base implementation
60-
const auto res_seq = stdla::dot(std::execution::seq, a, b, init_value);
61-
62-
// This forwards to KokkosKernels
63-
auto res_kk = stdla::dot(KokkosKernelsSTD::kokkos_exec<>(), a, b, init_value);
64-
65-
printf("Kokkos result = %lf\n", res_kk);
66-
printf("Seq result = %lf\n", res_seq);
67-
>>>>>>> dot: customization point to Kokkos-kernels and example
6838
}
6939
Kokkos::finalize();
7040
}

Diff for: include/experimental/__p1673_bits/blas1_dot.hpp

-6
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ struct is_custom_dot_avail<
7878

7979
} // end anonymous namespace
8080

81-
82-
// ------------
83-
// PUBLIC API:
84-
// ------------
85-
86-
// dot, with init value
8781
template<class ExecutionPolicy,
8882
class ElementType1,
8983
extents<>::size_type ext1,

0 commit comments

Comments
 (0)