4
4
5
5
int main (int argc, char * argv[])
6
6
{
7
- <<<<<<< HEAD
8
7
std::cout << " dot example: calling kokkos-kernels" << std::endl;
9
8
10
9
std::size_t N = 50 ;
@@ -22,28 +21,11 @@ int main(int argc, char* argv[])
22
21
mdspan_type a (a_ptr,N);
23
22
mdspan_type b (b_ptr,N);
24
23
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
41
24
a (i) = i;
42
25
b (i) = i;
43
26
}
44
27
45
28
namespace stdla = std::experimental::linalg;
46
- <<<<<<< HEAD
47
29
const value_type init_value (2.0 );
48
30
49
31
// This goes to the base implementation
@@ -53,18 +35,6 @@ int main(int argc, char* argv[])
53
35
// This forwards to KokkosKernels
54
36
const auto res_kk = stdla::dot (KokkosKernelsSTD::kokkos_exec<>(), a, b, init_value);
55
37
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
68
38
}
69
39
Kokkos::finalize ();
70
40
}
0 commit comments