kokkos-tutorials
所属分类:文章/文档
开发工具:C++
文件大小:71669KB
下载次数:0
上传日期:2023-06-02 22:39:44
上 传 者:
sh-1993
说明: Kokkos C++性能可移植编程生态系统教程
(Tutorials for the Kokkos C++ Performance Portability Programming EcoSystem)
文件列表:
Exercises (0, 2023-07-21)
Exercises\01 (0, 2023-07-21)
Exercises\01\Begin (0, 2023-07-21)
Exercises\01\Begin\CMakeLists.txt (192, 2023-07-21)
Exercises\01\Begin\Makefile (856, 2023-07-21)
Exercises\01\Begin\exercise_1_begin.cpp (6636, 2023-07-21)
Exercises\01\Solution (0, 2023-07-21)
Exercises\01\Solution\CMakeLists.txt (196, 2023-07-21)
Exercises\01\Solution\Makefile (856, 2023-07-21)
Exercises\01\Solution\exercise_1_solution.cpp (5681, 2023-07-21)
Exercises\02 (0, 2023-07-21)
Exercises\02\Begin (0, 2023-07-21)
Exercises\02\Begin\CMakeLists.txt (193, 2023-07-21)
Exercises\02\Begin\Makefile (866, 2023-07-21)
Exercises\02\Begin\exercise_2_begin.cpp (6371, 2023-07-21)
Exercises\02\Solution (0, 2023-07-21)
Exercises\02\Solution\CMakeLists.txt (196, 2023-07-21)
Exercises\02\Solution\Makefile (871, 2023-07-21)
Exercises\02\Solution\exercise_2_solution.cpp (5383, 2023-07-21)
Exercises\03 (0, 2023-07-21)
Exercises\03\Begin (0, 2023-07-21)
Exercises\03\Begin\CMakeLists.txt (193, 2023-07-21)
Exercises\03\Begin\Makefile (861, 2023-07-21)
Exercises\03\Begin\exercise_3_begin.cpp (6075, 2023-07-21)
Exercises\03\Solution (0, 2023-07-21)
Exercises\03\Solution\CMakeLists.txt (196, 2023-07-21)
Exercises\03\Solution\Makefile (861, 2023-07-21)
Exercises\03\Solution\exercise_3_solution.cpp (5755, 2023-07-21)
Exercises\04 (0, 2023-07-21)
Exercises\04\Begin (0, 2023-07-21)
Exercises\04\Begin\CMakeLists.txt (193, 2023-07-21)
Exercises\04\Begin\Makefile (861, 2023-07-21)
Exercises\04\Begin\exercise_4_begin.cpp (6931, 2023-07-21)
Exercises\04\Solution (0, 2023-07-21)
Exercises\04\Solution\CMakeLists.txt (196, 2023-07-21)
Exercises\04\Solution\Makefile (861, 2023-07-21)
Exercises\04\Solution\exercise_4_solution.cpp (6254, 2023-07-21)
Exercises\Makefile (1689, 2023-07-21)
... ...
![Kokkos](https://avatars2.githubusercontent.com/u/1019***60?s=200&v=4)
# 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 either the `Makefile` or the CMake `CMakeLists.txt` file in each folder.
## 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
## CMake + Spack
The CMake files build against an installed Kokkos library.
The easiest way to do this is using Spack.
There is a `spack.sh` script that automates most of this.
The Spack script can be run in any excercise folder with a `CMakeLists.txt`.
````
../../BuildScripts/spack.sh +openmp %gcc@7.3.0
````
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 `spack-build` folder where `make` can be run.
The `spack.sh` accepts the full list of variants and specs as the parent Kokkos package,
which can be viewed by running:
````
spack info kokkos
````
The `spack.sh` 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 `kk-spack.sh` script, e.g.
````
../../BuildScripts/kk-spack.sh +openmp %gcc@7.3.0 ^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.
近期下载者:
相关文件:
收藏者: