diff --git a/README.md b/README.md index e4c2a15..7e38453 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ This code was previously called GPU-STREAM. - [How is this different to STREAM?](#how-is-this-different-to-stream) - [Building](#building) - [CMake](#cmake) + - [Spack](#spack) - [GNU Make (removed)](#gnu-make) - [Results](#results) - [Contributing](#contributing) @@ -138,6 +139,35 @@ Alternatively, refer to the [CI script](./src/ci-test-compile.sh), which test-co *It is recommended that you delete the `build` directory when you change any of the build flags.* +### Spack + + +The project supports building with Spack >= 0.19.0, which can be installed without root via the [official GitHub repo](https://github.com/spack/spack). +The BabelStream Spack Package source code could be accessed from the link [here](https://github.com/spack/spack/tree/develop/var/spack/repos/builtin/packages/babelstream/package.py) +Each BabelStream implementation (programming model) is built as follows: + +```shell + +# Spack package installation starts with `spack install babelstream` for all programming models +# The programming model wish to be build needs to be specified with `+` option +# The model specific flags needs to be specified after defining model +$ spack install babelstream@% + + + +# The executables will be generated in: +# SPACK_INSTALL_DIRECTORY/opt/spack/system-name/compiler-name/babelstream-version-identifier/bin/ +# this address will be printed at the end of generation which could be easily copied +$ cd SPACK_INSTALL_DIRECTORY/opt/spack/system-name/compiler-name/babelstream-version-identifier/bin/ +$ ./-stream +``` +More detailed examples are provided in [Spack README file]() +The `MODEL` option selects one implementation of BabelStream to build. + +Currently available models are: +``` +omp;ocl;std;std20;hip;cuda;kokkos;sycl;sycl2020;acc;raja;tbb;thrust +``` + ### GNU Make Support for Make has been removed from 4.0 onwards. diff --git a/docs/spack_instructions.md b/docs/spack_instructions.md new file mode 100644 index 0000000..b6187b3 --- /dev/null +++ b/docs/spack_instructions.md @@ -0,0 +1,41 @@ +# Spack Instructions + +## Table of contents +* [OpenMP](#omp) +* [OpenCL](#ocl) +* [STD](#std) +* [STD20](#std20) +* [Hip](#hip) +* [Cuda](#cuda) +* [Kokkos](#kokkos) +* [Sycl](#sycl) +* [Sycl2020](#) +* [ACC](#acc) +* [Raja](#raja) +* [Tbb](#tbb) +* [Thrust](#thrust) + +## OpenMP + +* There are 3 offloading options for OpenMP: NVIDIA, AMD and Intel. +* If a user provides a value for `cuda_arch`, the execution will be automatically offloaded to NVIDIA. +* If a user provides a value for `amdgpu_target`, the operation will be offloaded to AMD. +* In the absence of `cuda_arch` and `amdgpu_target`, the execution will be offloaded to Intel. + +| Flag | Definition | Options | +|-----------| ----------------------------------|-----------| +| cuda_arch | List of supported compute capabilities are provided [here](https://github.com/spack/spack/blob/0f271883831bec6da3fc64c92eb1805c39a9f09a/lib/spack/spack/build_systems/cuda.py#LL19C1-L47C6)
Useful [link](https://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/) for matching CUDA gencodes with NVIDIA architectures| `cuda_arch=70` | +|amdgpu_target| List of supported architectures are provided [here](https://github.com/spack/spack/blob/0f271883831bec6da3fc64c92eb1805c39a9f09a/lib/spack/spack/build_systems/rocm.py#LL93C1-L125C19) | 'amdgpu_target=gfx701` | + +Example Commandss +```shell +# Example 1: for Intel offload + $ spack install babelstream%oneapi +omp + +# Example 2: for Nvidia GPU for Volta (sm_70) + $ spack install babelstream +omp cuda_arch=70 + +# Example 3: for AMD GPU gfx701 + $ spack install babelstream +omp amdgpu_target=gfx701 +``` +