-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
49 lines (40 loc) · 1.13 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <Kokkos_Core.hpp>
#define LOOK_INTO(var) printf("%d (%s): %.9E \n", __LINE__, #var, var)
int main() {
Kokkos::initialize();
{
#ifdef KOKKOS_ENABLE_CUDA
std::cout << "Using Cuda" << std::endl;
#endif
#ifdef KOKKOS_ENABLE_HIP
std::cout << "Using HIP" << std::endl;
#endif
#ifdef KOKKOS_ENABLE_OPENMP
std::cout << "Using OpenMP" << std::endl;
#endif
double capture_fraction = 1.1;
float hrad_sqr = 1.01;
double normal_name = 1.001;
printf("Inside main():\n");
LOOK_INTO(capture_fraction);
LOOK_INTO(hrad_sqr);
LOOK_INTO(normal_name);
Kokkos::parallel_for("kokkosSpotsKernel", 1, KOKKOS_LAMBDA(const int& pixIdx)
{
double I = 0;
double captur_efraction = 1.0001;
double useful_name = 1.00001;
printf("\nInside parallel_for():\n");
LOOK_INTO(capture_fraction);
LOOK_INTO(hrad_sqr);
LOOK_INTO(normal_name);
LOOK_INTO(captur_efraction);
LOOK_INTO(useful_name);
I = capture_fraction + hrad_sqr + normal_name + captur_efraction + useful_name;
LOOK_INTO(I);
});
}
Kokkos::finalize();
return 0;
}