Giter VIP home page Giter VIP logo

kokkos-tutorials's Introduction

Kokkos

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

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 Makefile or the CMake CMakeLists.txt file in each folder.

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:

cmake -B build_dir # -DKokkos_* options
cmake --build build_dir

Kokkos options are described in CMake options.

For example, OpenMP CPU exercises can be built as:

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:

cmake -B build_threads -DKokkos_ENABLE_THREADS=ON
cmake --build build_threads

For a NVIDIA gpu, using gpu arch autodetection:

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.

Makefiles

The raw Makefiles require Makefile variables to be properly configured. In most examples, this is KOKKOS_PATH pointing to the Kokkos source directory and KOKKOS_DEVICES 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
make test

in the Exercises directory.

Compatible means:

  • X86 with a NVIDIA V100 GPU
  • kokkos was cloned to ${HOME}/Kokkos/kokkos

kokkos-tutorials's People

Contributors

crtrott avatar dalg24 avatar ndellingwood avatar e10harvey avatar masterleinad avatar hcedwar avatar cedricchevalier19 avatar vqd8a avatar brian-kelley avatar rombur avatar jeffmiles63 avatar ibaned avatar seheracer avatar dsmishler avatar janciesko avatar lucbv avatar jrmadsen avatar pkestene avatar micheldemessieres avatar kyungjoo-kim avatar dwatersg avatar dsunder avatar ax3l avatar anhbe0 avatar blegouix avatar marcogarofalo avatar mhoemmen avatar nliber avatar nmm0 avatar srajama1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.