https://github.com/kokkos/kokkos-tutorials
Tutorials for the Kokkos C++ Performance Portability Programming Ecosystem
https://github.com/kokkos/kokkos-tutorials
Last synced: 9 months ago
JSON representation
Tutorials for the Kokkos C++ Performance Portability Programming Ecosystem
- Host: GitHub
- URL: https://github.com/kokkos/kokkos-tutorials
- Owner: kokkos
- License: other
- Created: 2015-09-04T03:15:02.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T14:56:16.000Z (11 months ago)
- Last Synced: 2025-04-01T05:37:59.935Z (9 months ago)
- Language: TeX
- Homepage: https://kokkos.org
- Size: 137 MB
- Stars: 316
- Watchers: 47
- Forks: 106
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Kokkos Tutorials
This repository contains tutorials for the Kokkos C++ programming
model (github.com/kokkos/kokkos).
## The Kokkos Lectures
We are currently running **The Kokkos Lectures** - an extended version
of our **Intro-Full** Tutorial, spanning 8 modules. For information on that,
Slides and Recordings visit: [The Kokkos Lectures Wiki](https://github.com/kokkos/kokkos-tutorials/wiki/Kokkos-Lecture-Series)
## Other Tutorial Compilations
Tutorials in the **Intro-Short** directory cover
* simple data parallel patterns and policies
* multidimensional array views
* execution and memory spaces
Tutorials in the **Intro-Full** directory cover
* simple data parallel patterns and policies
* multidimensional array views
* execution and memory spaces
* thread safety and atomic operations
* hierarchical data parallel patterns
# Building the Tutorials
All the tutorial folders can be built using CMake.
## CMake
CMake can build against an installed Kokkos library or download one automatically using `FetchContent`.
Without any Kokkos already installed, from an exercise directory, one can run the following:
```shell
cmake -B build_dir # -DKokkos_* options
cmake --build build_dir
```
Kokkos options are described in [CMake options](https://kokkos.org/kokkos-core-wiki/keywords.html).
For example, OpenMP CPU exercises can be built as:
```shell
cmake -B build_openmp -DKokkos_ENABLE_OPENMP=ON
cmake --build build_openmp
```
On Mac, if OpenMP is not available, one can use the Threads backend:
```shell
cmake -B build_threads -DKokkos_ENABLE_THREADS=ON
cmake --build build_threads
```
For a NVIDIA gpu, using gpu arch autodetection:
```shell
cmake -B build_cuda -DKokkos_ENABLE_CUDA=ON
cmake --build build_cuda
```
To pass an already installed Kokkos library, you can use classical CMake variables,
such as `Kokkos_ROOT`, or `CMAKE_PREFIX_PATH`.