Skip to content

Commit 9da3235

Browse files
committed
Improve documentation
1 parent 2f516c6 commit 9da3235

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

cmake/SetUpKokkos.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Setup Kokkos as either an external dependency, or an inlined dependency. In
2+
# the former, Kokkos has already been compiled and installed, and its install
3+
# path is given to CMake with `Kokkos_ROOT` option. In the later, Kokkos
4+
# sources are either already present as a Git submodule, or they are downloaded
5+
# by this script using CMake `FetchContent`; in either case Kokkos sources are
6+
# located in `/vendor/kokkos` and compiled along with the project, which means
7+
# that Kokkos options must be passed at configuration time. If the option
8+
# `CMAKE_DISABLE_FIND_PACKAGE_Kokkos` is `ON`, then no installed instance of
9+
# Kokkos will be used, and only the inline build of Kokkos will take place.
10+
# Conversely, if the option `CMAKE_REQUIRE_FIND_PACKAGE_Kokkos` is `ON`, then
11+
# only an installed instance of Kokkos will be used.
12+
#
13+
# See
14+
# https://kokkos.org/kokkos-core-wiki/get-started/integrating-kokkos-into-your-cmake-project.html#supporting-both-external-and-embedded-kokkos
15+
116
# set CMAKE_BUILD_TYPE if not defined
217
if(NOT CMAKE_BUILD_TYPE)
318
set(default_build_type "RelWithDebInfo")

exercises/01_first_program/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ The goal is to get familiar with the compiling process.
66
## Step 1: Simple Kokkos program
77

88
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.
1010

1111
Add a call to the `Kokkos::print_configuration` function to print the configuration of Kokkos.
1212

1313
## Step 2: Compile the program with the serial backend
1414

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+
1522
Compile your program using the serial backend.
1623
You can use the following commands:
1724

@@ -21,6 +28,7 @@ cmake -B build_serial
2128
cmake --build build_serial
2229
```
2330

31+
This would use build Kokkos along with your code.
2432
If you have already installed Kokkos in exercise 0, then you can use the following commands instead:
2533

2634
```sh

0 commit comments

Comments
 (0)