Need help with kokkos-tutorials?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

180 Stars 59 Forks 197 Commits 13 Opened issues


Tutorials for the Kokkos C++ Performance Portability Programming EcoSystem

Services available


Need anything else?

Contributors list


Kokkos Tutorials

This repository contains tutorials for the Kokkos C++ programming model (

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

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 either the

or the CMake
file in each folder.


The raw Makefiles require Makefile variables to be properly configured. In most examples, this is

pointing to the Kokkos source directory and
which contains the list of device backends to build. This will build a new Kokkos library for each exercise.

If you are on a system compatible to our AWS instances, you can type

make test
in the

Compatible means: * X86 with a NVIDIA V100 GPU * kokkos was cloned to ${HOME}/Kokkos/kokkos

CMake + Spack

The CMake files build against an installed Kokkos library. The easiest way to do this is using Spack. There is a
script that automates most of this. The Spack script can be run in any excercise folder with a
../../BuildScripts/ +openmp %[email protected]

This will make sure Kokkos is installed with the OpenMP backend for the GCC 7.3.0 compiler. It will then configure CMake and create a

folder where
can be run. The
accepts the full list of variants and specs as the parent Kokkos package, which can be viewed by running:
spack info kokkos

script uses the special DIY mode of Spack to install dependencies and configure the current source folder to build.

For Kokkos Kernels tutorials, there is similarly a
script, e.g.
../../BuildScripts/ +openmp %[email protected] ^kokkos+aggressive_vectorization
All the arguments to the script get passed as a spec for the tutorial. We are indirectly configuring Kokkos, hence the
notation for specifying the exact Kokkos dependency spec.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.