You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exercises/01_first_program/README.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,19 @@ The goal is to get familiar with the compiling process.
6
6
## Step 1: Simple Kokkos program
7
7
8
8
In `exercise`, open the file `main.cpp`, initialize and finalize Kokkos.
9
-
Do not forget to add the header.
9
+
Do not forget to include the header.
10
10
11
11
Add a call to the `Kokkos::print_configuration` function to print the configuration of Kokkos.
12
12
13
13
## Step 2: Compile the program with the serial backend
14
14
15
+
Open the `CMakeLists.txt` file and check its content.
16
+
In all this tutorial, Kokkos is included to your build with the `/cmake/SetUpKokkos.cmake` script, either as an external dependency, or as an inlined dependency.
17
+
In the former, Kokkos has already been compiled and installed, and its install path is given to CMake with `Kokkos_ROOT` option.
18
+
In the later, Kokkos sources are either already present as a Git submodule, or they are downloaded by the script using CMake `FetchContent`; in either case Kokkos sources are located in `/vendor/kokkos` and compiled along with the project, which means that Kokkos options must be passed at configuration time.
19
+
If the option `CMAKE_DISABLE_FIND_PACKAGE_Kokkos` is `ON`, then no installed instance of Kokkos will be used, and only the inline build of Kokkos will take place.
20
+
Conversely, if the option `CMAKE_REQUIRE_FIND_PACKAGE_Kokkos` is `ON`, then only an installed instance of Kokkos will be used.
21
+
15
22
Compile your program using the serial backend.
16
23
You can use the following commands:
17
24
@@ -21,6 +28,7 @@ cmake -B build_serial
21
28
cmake --build build_serial
22
29
```
23
30
31
+
This would use build Kokkos along with your code.
24
32
If you have already installed Kokkos in exercise 0, then you can use the following commands instead:
0 commit comments