diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..73190f9ab3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,113 @@ +.base_job: + script: + # the default build type is Release + # if neccesary, you can rerun the pipeline with another build type-> https://docs.gitlab.com/ee/ci/pipelines.html#manually-executing-pipelines + # to change the build type, you must set the environment variable CUPLA_BUILD_TYPE + - if [[ ! -v CUPLA_BUILD_TYPE ]] ; then + CUPLA_BUILD_TYPE=Release ; + fi + - echo "number of processor threads $(nproc)" + - $CXX --version + - cmake --version + # print boost version + - echo -e "#include \n#include \nint main() { std::cout << BOOST_VERSION << std::endl; return 0; }" | $CXX -x c++ - -o boost_version >/dev/null || { echo 0; } + - echo "Boost version $(./boost_version)" + - export cupla_DIR=$CI_PROJECT_DIR + # use one build directory for all build configurations + - mkdir build + - cd build + - echo "Build type-> $CUPLA_BUILD_TYPE" + # ALPAKA_ACCS contains the backends, which are used for each build + # the backends are set in the sepcialized base jobs .base_gcc,.base_clang and.base_cuda + - for CMAKE_FLAGS in $ALPAKA_ACCS ; do + echo "###################################################" + && echo "# Example Matrix Multiplication (adapted original)" + && echo "###################################################" + && echo "can not run with CPU_B_SEQ_T_SEQ due to missing elements layer in original SDK example" + && echo "CPU_B_SEQ_T_OMP2/THREADS too many threads necessary (256)" + && if [[ $CMAKE_FLAGS =~ -*DALPAKA_ACC_GPU_CUDA_ENABLE=ON.* ]]; then + cmake $cupla_DIR/example/CUDASamples/matrixMul/ $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE + && make -j + && time ./matrixMul -wA=64 -wB=64 -hA=64 -hB=64 + && rm -r * ; + fi + && echo "###################################################" + && echo "# Example Async API (adapted original)" + && echo "###################################################" + && echo "can not run with CPU_B_SEQ_T_SEQ due to missing elements layer in original SDK example" + && echo "CPU_B_SEQ_T_OMP2/THREADS too many threads necessary (512)" + && if [[ $CMAKE_FLAGS =~ -*DALPAKA_ACC_GPU_CUDA_ENABLE=ON.* ]]; then + cmake $cupla_DIR/example/CUDASamples/asyncAPI/ $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE + && make -j + && time ./asyncAPI + && rm -r * ; + fi + && echo "###################################################" + && echo "# Example Async API (added elements layer)" + && echo "###################################################" + && cmake $cupla_DIR/example/CUDASamples/asyncAPI_tuned/ $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE + && make -j + && time ./asyncAPI_tuned + && rm -r * + && echo "###################################################" + && echo "Example vectorAdd (added elements layer)" + && echo "###################################################" + && cmake $cupla_DIR/example/CUDASamples/vectorAdd/ $CMAKE_FLAGS -DCMAKE_BUILD_TYPE=$CUPLA_BUILD_TYPE + && make -j + && time ./vectorAdd 100000 + && rm -r * ; + done + +.base_gcc: + variables: + GIT_SUBMODULE_STRATEGY: normal + CXX: g++ + CC: gcc + ALPAKA_ACCS: "-DALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE=ON + -DALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=ON + -DALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE=ON" + # -DALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE=ON + extends: .base_job + # x86_64 tag is used to get a multi-core CPU for the tests + tags: + - x86_64 + +.base_clang: + variables: + GIT_SUBMODULE_STRATEGY: normal + CXX: clang++ + CC: clang + ALPAKA_ACCS: "-DALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE=ON + -DALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE=ON" + # -DALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=ON + # -DALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE=ON + extends: .base_job + # x86_64 tag is used to get a multi-core CPU for the tests + tags: + - x86_64 + +.base_cuda: + variables: + GIT_SUBMODULE_STRATEGY: normal + CXX: g++ + CC: gcc + ALPAKA_ACCS: "-DALPAKA_ACC_GPU_CUDA_ENABLE=ON" + before_script: + - nvidia-smi + - nvcc --version + extends: .base_job + tags: + - cuda + - intel + +gcc7: + image: registry.gitlab.com/hzdr/cupla-docker/gcc7:latest + extends: .base_gcc + +clang7: + image: registry.gitlab.com/hzdr/cupla-docker/clang7:latest + extends: .base_clang + +cuda9: + image: registry.gitlab.com/hzdr/cupla-docker/cuda9:latest + extends: .base_cuda diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 1ad98f4c1b..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "alpaka"] - path = alpaka - url = git://github.com/ComputationalRadiationPhysics/alpaka.git - branch = develop diff --git a/.travis.yml b/.travis.yml index 7f27e6eb6a..c87256bb89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,7 @@ before_install: - mkdir -p $HOME/asyncAPI - mkdir -p $HOME/asyncAPI_tuned - mkdir -p $HOME/vectorAdd + - mkdir -p $HOME/test/config - export CMAKE_FLAGS="-DALPAKA_ACC_"$STRATEGY"_ENABLE=ON" - if [ "$COMPILER" == "gcc" ]; then echo "Using g++-4.9 and sequential OpenMP2 threads ..."; @@ -66,15 +67,15 @@ install: # CMAKE # ############################################################################# - export PATH=$CMAKE_ROOT/bin:$PATH - - CMAKE_311_FOUND=$(cmake --version | grep " 3\.11\." >/dev/null && { echo 0; } || { echo 1; }) - - if [ $CMAKE_311_FOUND -ne 0 ]; then + - CMAKE_315_FOUND=$(cmake --version | grep " 3\.15\." >/dev/null && { echo 0; } || { echo 1; }) + - if [ $CMAKE_315_FOUND -ne 0 ]; then mkdir -p $CMAKE_ROOT && cd $CMAKE_ROOT && rm -rf $CMAKE_ROOT/* && - travis_retry wget --no-check-certificate http://cmake.org/files/v3.11/cmake-3.11.0-Linux-x86_64.tar.gz && - tar -xzf cmake-3.11.0-Linux-x86_64.tar.gz && - mv cmake-3.11.0-Linux-x86_64/* . && - rm -rf cmake-3.11.0-Linux-x86_64.tar.gz cmake-3.11.0-Linux-x86_64 && + travis_retry wget --no-check-certificate http://cmake.org/files/v3.15/cmake-3.15.4-Linux-x86_64.tar.gz && + tar -xzf cmake-3.15.4-Linux-x86_64.tar.gz && + mv cmake-3.15.4-Linux-x86_64/* . && + rm -rf cmake-3.15.4-Linux-x86_64.tar.gz cmake-3.15.4-Linux-x86_64 && cd -; fi - cmake --version @@ -155,5 +156,9 @@ script: ./vectorAdd 100000; fi ############################################################################# - # Test: (To do: add tests in $TRAVIS_BUILD_DIR/test/ # + # Test: additional tests # ############################################################################# + - cd $HOME/test/config + - if [[ $CXX =~ "^g\+\+" ]] || [[ "$COMPILER" == "nvcc" ]] ; then + $TRAVIS_BUILD_DIR/test/system/config/test.sh $CXX; + fi diff --git a/INSTALL.md b/INSTALL.md index 8b4fa152df..06eae4b444 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,28 +16,52 @@ Requirements - `mkdir -p $HOME/src` - `git clone git://github.com/ComputationalRadiationPhysics/cupla.git $HOME/src/cupla` - `cd $HOME/src/cupla` - - `git submodule init` - - `git submodule update` - `export CUPLA_ROOT=$HOME/src/cupla` - - use cupla without the submodule alpaka: - Set the advanced CMake variable `cupla_ALPAKA_PROVIDER` to `extern` and + - use a different alpaka installation: set environment variable `ALPAKA_ROOT` or extend `CMAKE_PREFIX_PATH` with the path to alpaka. - -compile an example ------------------ + +Compile an example +------------------ - create build directory `mkdir -p buildCuplaExample` - `cd buildCuplaExample` - `cmake $CUPLA_ROOT/example/CUDASamples/matrixMul -D=ON` - - list of supported ACC_TYPES + - list of supported `ACC_TYPE`s - `ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE` - `ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE` - `ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE` - `ALPAKA_ACC_GPU_CUDA_ENABLE` + - `ALPAKA_ACC_CPU_BT_OMP4_ENABLE` - `ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE` (only allowed in combination with `CUPLA_KERNEL_OPTI` and `CUPLA_KERNEL_ELEM`, because the `blockSize` must be `dim3(1,1,1)`) see [TuningGuide.md](doc/TuningGuide.md) - `make -j` - `./matrixMul -wA=320 -wB=320 -hA=320 -hB=320` (parameters must be a multiple of 32!) + + +How to update alpaka as git subtree? +------------------------------------ + +```zsh +# git author is generic to not mess up contribution statistics +GIT_AUTHOR_NAME="Third Party" GIT_AUTHOR_EMAIL="crp-git@hzdr.de" \ + git subtree pull --prefix alpaka \ + https://github.com/ComputationalRadiationPhysics/alpaka.git develop --squash +``` + +**How to commit local changes to alpaka upstream?** + +If your local alpaka version contains changes you want to contribute back upstream via fork, then you can use `git subtree push`: + +```zsh +# Add your fork of alpaka to git remotes +git remote add alpaka-fork git@github.com:YOUR_NAME/alpaka.git + +# Push your changes to your fork +git subtree push --prefix=alpaka alpaka-fork +``` +Then check your github page of your fork to open a pull request upstream. + +More information can be found in this [git subtree guide](https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree). diff --git a/README.md b/README.md index 08b5c9b59a..a8a3840004 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,8 @@ Dependencies ------------ - **cmake 3.11.0** -- **alpaka** - - is loaded as `git submodule` within **cupla** (see [INSTALL.md](INSTALL.md)) - - for more information please read [README.md](https://github.com/ComputationalRadiationPhysics/alpaka/blob/master/README.md) +- **[alpaka](https://github.com/ComputationalRadiationPhysics/alpaka/)** + - alpaka is loaded as `git subtree` within **cupla**, see [INSTALL.md](INSTALL.md) Usage ----- @@ -49,6 +48,7 @@ Usage - Checkout the [tuning guide](doc/TuningGuide.md) for a step further to performance portable code. +[cupla can be used as a header-only library and without the CMake build system](doc/ConfigurationHeader.md) Authors ------- @@ -56,6 +56,7 @@ Authors ### Maintainers and core developers - Rene Widera +- Matthias Werner ### Former Members, Contributions and Thanks diff --git a/alpaka b/alpaka deleted file mode 160000 index c922a19c2a..0000000000 --- a/alpaka +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c922a19c2acfd743e1251680dc2b87863ee1549b diff --git a/alpaka/.dockerignore b/alpaka/.dockerignore new file mode 100644 index 0000000000..6b8710a711 --- /dev/null +++ b/alpaka/.dockerignore @@ -0,0 +1 @@ +.git diff --git a/alpaka/.gitignore b/alpaka/.gitignore new file mode 100644 index 0000000000..c2d802bd65 --- /dev/null +++ b/alpaka/.gitignore @@ -0,0 +1,18 @@ +/doc/doxygen/* +!/doc/doxygen/Doxyfile +!/doc/doxygen/alpaka_doxygen.png +/doc/latex/* +**/build + +# tmp files +*~ + +# netbeans project files +/nbproject/ + +# Code::Blocks project files +/*.cbp +/*.layout + +# original backup files +*.orig diff --git a/alpaka/.travis.yml b/alpaka/.travis.yml new file mode 100644 index 0000000000..94d12553bc --- /dev/null +++ b/alpaka/.travis.yml @@ -0,0 +1,347 @@ +# +# Copyright 2015-2019 Benjamin Worpitz, Erik Zenker +# +# This file is part of Alpaka. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +os: linux +dist: xenial +language: generic +services: + - docker + +################################################################################ +# NOTE: Testing the full matrix is not practical. +# Therefore we aim to have each value been set in at lest one job. +# CXX : {g++, clang++, cl.exe} +# [g++] ALPAKA_CI_GCC_VER : {4.9, 5, 6, 7, 8, 9} +# [clang++] ALPAKA_CI_CLANG_VER : {4.0.0, 5.0.2, 6.0.1, 7.0.1, 8.0.0, 9.0.0} +# ALPAKA_CI_STDLIB : {libstdc++, [CXX==clang++]:libc++} +# [clang++] ALPAKA_CI_CLANG_LIBSTDCPP_VERSION : {5, 7} +# CMAKE_BUILD_TYPE : {Debug, Release} +# ALPAKA_CI : {TRAVIS} +# ALPAKA_CI_DOCKER_BASE_IMAGE_NAME : {ubuntu:14.04, ubuntu:16.04, ubuntu:18.04} +# ALPAKA_CI_BOOST_BRANCH : {[CXX!=cl.exe&&OS!=osx]:boost-1.62.0, [CXX!=cl.exe&&OS!=osx]:boost-1.63.0, [OS!=osx]boost-1.64.0, boost-1.65.1, boost-1.66.0, boost-1.67.0, boost-1.68.0, boost-1.69.0, boost-1.70.0, boost-1.71.0} +# ALPAKA_CI_CMAKE_VER : {3.11.4, 3.12.4, 3.13.5, 3.14.4, 3.15.2} +# ALPAKA_CI_SANITIZERS : {ASan, UBsan, TSan} +# TSan is not currently used because it produces many unexpected errors +# ALPAKA_CI_ANALYSIS : {ON, OFF} +# ALPAKA_DEBUG : {0, 1, 2} +# ALPAKA_ACC_GPU_CUDA_ONLY_MODE : {ON, OFF} +# ALPAKA_ACC_GPU_HIP_ONLY_MODE : {ON, OFF} +# ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE : {ON, OFF} +# ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE : {ON, OFF} +# ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE : {ON, OFF} +# ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE : {ON, OFF} +# [ON] OMP_NUM_THREADS : {1, 2, 3, 4} +# ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE : {ON, OFF} +# [ON] OMP_NUM_THREADS : {1, 2, 3, 4} +# ALPAKA_ACC_CPU_BT_OMP4_ENABLE : {ON, OFF} +# [ON] OMP_NUM_THREADS : {1, 2, 3, 4} +# ALPAKA_ACC_GPU_CUDA_ENABLE : {ON, OFF} +# [ON] ALPAKA_CUDA_VERSION : {8.0, 9.0, 9.1, 9.2, 10.0, 10.1} +# [ON] ALPAKA_CUDA_COMPILER : {nvcc, [CXX==clang++]:clang} +# ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE : {ON, OFF} +# ALPAKA_ACC_GPU_HIP_ENABLE : {ON, OFF} +# [ON] ALPAKA_CI_HIP_BRANCH : {master} +# [ON] ALPAKA_HIP_PLATFORM : {nvcc} +env: + global: + - ALPAKA_CI=TRAVIS + - ALPAKA_CI_DOCKER_IMAGE_NAME=alpaka_ubuntu + - ALPAKA_CI_DOCKER_CACHE_DIR=${HOME}/cache/docker + - ALPAKA_CI_DOCKER_CACHE_IMAGE_FILE_PATH=${ALPAKA_CI_DOCKER_CACHE_DIR}/${ALPAKA_CI_DOCKER_IMAGE_NAME}.tar.gz + - BOOST_ROOT=${HOME}/boost + - ALPAKA_CI_BOOST_LIB_DIR=${HOME}/boost_libs/ + - ALPAKA_CI_CLANG_DIR=${HOME}/llvm + - ALPAKA_CI_CMAKE_DIR=${HOME}/CMake + - ALPAKA_CI_CUDA_DIR=${HOME}/CUDA + - ALPAKA_CI_HIP_ROOT_DIR=${HOME}/hip + - TBB_ROOT_DIR=${HOME}/tbb + - ALPAKA_CI_SANITIZERS= + - ALPAKA_CI_ANALYSIS=OFF + - ALPAKA_CI_CLANG_LIBSTDCPP_VERSION=5 + - ALPAKA_ACC_GPU_CUDA_ENABLE=OFF + - ALPAKA_ACC_GPU_HIP_ENABLE=OFF + +matrix: + include: + ### Analysis builds + - name: nvcc-9.1 + gcc-4.9 Debug Analysis + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_CI_ANALYSIS=ON ALPAKA_DEBUG=2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.1 ALPAKA_CUDA_COMPILER=nvcc + - name: gcc-8 Debug Analysis + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=8 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.66.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_CI_ANALYSIS=ON ALPAKA_DEBUG=2 + - name: clang-4 + CUDA-8.0 Debug Analysis + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_CI_ANALYSIS=ON ALPAKA_DEBUG=1 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=8.0 ALPAKA_CUDA_COMPILER=clang + - name: clang-6 Debug Analysis + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=6.0.1 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_CI_ANALYSIS=ON ALPAKA_DEBUG=2 + - name: macOS 10.14 Xcode 11.2 Debug Analysis + os: osx + osx_image: xcode11.2 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_ANALYSIS=ON ALPAKA_DEBUG=2 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF + - name: MSVC-2017 Debug Analysis + os: windows + dist: 1803-containers + language: cpp + env: CXX=cl.exe CC=cl.exe CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_CI_ANALYSIS=ON ALPAKA_DEBUG=2 + + ### macOS + - name: macOS 10.14 Xcode 10.2.1 Debug + os: osx + osx_image: xcode10.2 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF ALPAKA_CXX_STANDARD=14 + - name: macOS 10.14 Xcode 10.2.1 Release + os: osx + osx_image: xcode10.2 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF + + - name: macOS 10.14.4 Xcode 10.3 Debug + os: osx + osx_image: xcode10.3 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF ALPAKA_CXX_STANDARD=14 + - name: macOS 10.14.4 Xcode 10.3 Release + os: osx + osx_image: xcode10.3 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF + + - name: macOS 10.14 Xcode 11.0 Debug + os: osx + osx_image: xcode11 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF ALPAKA_CXX_STANDARD=14 + - name: macOS 10.14 Xcode 11.0 Release + os: osx + osx_image: xcode11 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF + + - name: macOS 10.14 Xcode 11.1 Debug + os: osx + osx_image: xcode11.1 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF ALPAKA_CXX_STANDARD=14 + - name: macOS 10.14 Xcode 11.1 Release + os: osx + osx_image: xcode11.1 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF + + - name: macOS 10.14 Xcode 11.2 Debug + os: osx + osx_image: xcode11.2 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF ALPAKA_CXX_STANDARD=14 + - name: macOS 10.14 Xcode 11.2 Release + os: osx + osx_image: xcode11.2 + env: CXX=g++ CC=gcc CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF + + ### Windows + - name: MSVC-2017 Release + os: windows + dist: 1803-containers + language: cpp + env: CXX=cl.exe CC=cl.exe CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.14.4 OMP_NUM_THREADS=4 ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=OFF + - name: MSVC-2017 Debug + os: windows + dist: 1803-containers + language: cpp + env: CXX=cl.exe CC=cl.exe CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.64.0 ALPAKA_CI_CMAKE_VER=3.11.4 OMP_NUM_THREADS=4 ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=OFF ALPAKA_CXX_STANDARD=14 + + ### Ubuntu + ## native + # g++ + # We can not enable UBSan when using gcc because it does not have a -fsanitize-blacklist option to suppress errors in boost etc. + # gcc 6 ASan is triggered within libtbb.so + # gcc 7 ASan introduced 'stack-use-after-scope' which is triggered by GOMP_parallel + - name: gcc-4.9 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.62.0 ALPAKA_CI_CMAKE_VER=3.11.4 OMP_NUM_THREADS=4 ALPAKA_CXX_STANDARD=11 + - name: gcc-5 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.66.0 ALPAKA_CI_CMAKE_VER=3.15.2 OMP_NUM_THREADS=3 + - name: gcc-6 Debug c++14 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=6 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.14.4 OMP_NUM_THREADS=2 ALPAKA_CXX_STANDARD=14 + - name: gcc-7 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=7 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.63.0 ALPAKA_CI_CMAKE_VER=3.13.5 OMP_NUM_THREADS=3 + - name: gcc-8 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=8 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.12.4 OMP_NUM_THREADS=4 + - name: gcc-9 Debug c++17 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.15.2 OMP_NUM_THREADS=3 ALPAKA_CXX_STANDARD=17 ALPAKA_ACC_CPU_BT_OMP4_ENABLE=OFF + + # clang++ + - name: clang-4 Debug UBSan + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.11.4 OMP_NUM_THREADS=4 ALPAKA_CI_SANITIZERS=UBSan + - name: clang-5 Debug c++14 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=5.0.2 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.63.0 ALPAKA_CI_CMAKE_VER=3.14.4 OMP_NUM_THREADS=3 ALPAKA_CXX_STANDARD=14 + - name: clang-6 Release ASan C++17 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=6.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.15.2 OMP_NUM_THREADS=2 ALPAKA_CI_SANITIZERS=ASan ALPAKA_CXX_STANDARD=17 + - name: clang-7 Release c++17 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=7.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.13.5 OMP_NUM_THREADS=2 ALPAKA_CXX_STANDARD=17 ALPAKA_CI_CLANG_LIBSTDCPP_VERSION=7 + - name: clang-8 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=8.0.0 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.12.4 OMP_NUM_THREADS=4 + - name: clang-9 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=9.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.15.2 OMP_NUM_THREADS=3 + + ## CUDA 8.0 + # nvcc + g++ + - name: nvcc-8.0 + gcc-4.9 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.62.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=8.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="20;60" ALPAKA_CXX_STANDARD=11 + # clang++ + - name: clang-4 + CUDA-8.0 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=8.0 ALPAKA_CUDA_COMPILER=clang + - name: clang-5 + CUDA-8.0 Release ALPAKA_ACC_GPU_CUDA_ONLY_MODE + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=5.0.2 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=8.0 ALPAKA_CUDA_COMPILER=clang ALPAKA_CUDA_ARCH="20;35" ALPAKA_ACC_GPU_CUDA_ONLY_MODE=ON + - name: clang-6 + CUDA-8.0 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=6.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.64.0 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=8.0 ALPAKA_CUDA_COMPILER=clang + - name: clang-7 + CUDA-8.0 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=7.0.1 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=8.0 ALPAKA_CUDA_COMPILER=clang + - name: clang-8 + CUDA-8.0 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=8.0.0 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=8.0 ALPAKA_CUDA_COMPILER=clang + + ## CUDA 9.0 + # nvcc + g++ + - name: nvcc-9.0 + gcc-4.9 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.0 ALPAKA_CUDA_COMPILER=nvcc + - name: nvcc-9.0 + gcc-5 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="70" + # clang++ + - name: clang-6 + CUDA-9.0 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=6.0.1 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.0 ALPAKA_CUDA_COMPILER=clang ALPAKA_CUDA_ARCH="35" + - name: clang-7 + CUDA-9.0 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=7.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.0 ALPAKA_CUDA_COMPILER=clang ALPAKA_CUDA_ARCH="35;70" + - name: clang-8 + CUDA-9.0 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=8.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.0 ALPAKA_CUDA_COMPILER=clang + + ## CUDA 9.1 + # nvcc + g++ + - name: nvcc-9.1 + gcc-4.9 Debug ALPAKA_ACC_GPU_CUDA_ONLY_MODE + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;72" ALPAKA_ACC_GPU_CUDA_ONLY_MODE=ON + - name: nvcc-9.1 + gcc-5 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.1 ALPAKA_CUDA_COMPILER=nvcc + # nvcc + clang++ + - name: nvcc-9.1 + clang-4 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;70" + # clang++ + - name: clang-7 + CUDA-9.1 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=7.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.1 ALPAKA_CUDA_COMPILER=clang ALPAKA_CUDA_ARCH="35;72" + - name: clang-8 + CUDA-9.1 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=8.0.0 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.1 ALPAKA_CUDA_COMPILER=clang + + ## CUDA 9.2 + # nvcc + g++ + - name: nvcc-9.2 + gcc-4.9 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;72" + - name: nvcc-9.2 + gcc-5 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=nvcc + - name: nvcc-9.2 + gcc-6 Debug separable compilation + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=6 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_NVCC_SEPARABLE_COMPILATION=ON + - name: nvcc-9.2 + gcc-7 Release + relaxed constexpr off + extended lambda off + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=7 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;35" ALPAKA_CUDA_NVCC_EXPT_RELAXED_CONSTEXPR=OFF ALPAKA_CUDA_NVCC_EXPT_EXTENDED_LAMBDA=OFF + # nvcc + clang++ + - name: nvcc-9.2 + clang-4 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;70" + # clang++ + - name: clang-7 + CUDA-9.2 Release c++17 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=7.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=clang ALPAKA_CUDA_ARCH="35;72" ALPAKA_CXX_STANDARD=17 + - name: clang-8 + CUDA-9.2 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=8.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=clang + - name: clang-9 + CUDA-9.2 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=9.0.0 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=clang + + ## CUDA 10.0 + # nvcc + g++ + - name: nvcc-10.0 + gcc-4.9 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;75" + - name: nvcc-10.0 + gcc-5 Release c++14 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CXX_STANDARD=14 + - name: nvcc-10.0 + gcc-6 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=6 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=nvcc + - name: nvcc-10.0 + gcc-7 Release c++14 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=7 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;35" ALPAKA_CXX_STANDARD=14 + # nvcc + clang++ + - name: nvcc-10.0 + clang-4 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;60" + - name: nvcc-10.0 + clang-5 Debug separable compilation + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=5.0.2 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="75" ALPAKA_CUDA_NVCC_SEPARABLE_COMPILATION=ON + - name: nvcc-10.0 + clang-6 Debug c++14 + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=6.0.1 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="70" ALPAKA_CXX_STANDARD=14 + # nvcc + MSVC + - name: nvcc-10.0 + MSVC-2017 Release ALPAKA_ACC_GPU_CUDA_ONLY_MODE separable compilation + os: windows + dist: 1803-containers + language: cpp + env: CXX=cl.exe CC=cl.exe CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_ARCH="30;75" ALPAKA_ACC_GPU_CUDA_ONLY_MODE=ON ALPAKA_CUDA_NVCC_SEPARABLE_COMPILATION=ON + - name: nvcc-10.0 + MSVC-2017 Debug (Only one CPU backend enabled due to compile time) + os: windows + dist: 1803-containers + language: cpp + env: CXX=cl.exe CC=cl.exe CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.66.0 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=OFF ALPAKA_ACC_CPU_BT_OMP4_ENABLE=OFF ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE=OFF + # clang++ + - name: clang-8 + CUDA-10.0 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=8.0.0 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=clang + - name: clang-9 + CUDA-10.0 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=9.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.0 ALPAKA_CUDA_COMPILER=clang + + ## CUDA 10.1 + # nvcc + g++ + - name: nvcc-10.1 + gcc-4.9 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=4.9 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;75" + - name: nvcc-10.1 + gcc-5 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.68.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc + - name: nvcc-10.1 + gcc-6 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=6 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc + - name: nvcc-10.1 + gcc-7 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=7 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;35" + - name: nvcc-10.1 + gcc-8 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=8 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;35" + # nvcc + clang++ + - name: nvcc-10.1 + clang-4 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=4.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;60" + - name: nvcc-10.1 + clang-5 Release ALPAKA_ACC_GPU_CUDA_ONLY_MODE + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=5.0.2 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libc++ ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="75" ALPAKA_ACC_GPU_CUDA_ONLY_MODE=ON + - name: nvcc-10.1 + clang-6 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=6.0.1 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="70" + - name: nvcc-10.1 + clang-7 Release + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=7.0.1 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.69.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="70" + - name: nvcc-10.1 + clang-8 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=8.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="75" + # nvcc + MSVC + - name: nvcc-10.1 + MSVC-2017 Debug ALPAKA_ACC_GPU_CUDA_ONLY_MODE + os: windows + dist: 1803-containers + language: cpp + env: CXX=cl.exe CC=cl.exe CMAKE_BUILD_TYPE=Debug ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_ARCH="30;75" ALPAKA_ACC_GPU_CUDA_ONLY_MODE=ON + - name: nvcc-10.1 + MSVC-2017 Release (Only one CPU backend enabled due to compile time) + os: windows + dist: 1803-containers + language: cpp + env: CXX=cl.exe CC=cl.exe CMAKE_BUILD_TYPE=Release ALPAKA_CI_BOOST_BRANCH=boost-1.65.1 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE=OFF ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE=OFF ALPAKA_ACC_CPU_BT_OMP4_ENABLE=OFF ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE=OFF + # clang++ + - name: clang-9 + CUDA-10.1 Debug + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=clang++ CC=clang ALPAKA_CI_CLANG_VER=9.0.0 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.14.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.1 ALPAKA_CUDA_COMPILER=clang + + ## HIP + - name: HIP(nvcc9.2) + gcc-5 Debug ALPAKA_ACC_GPU_HIP_ONLY_MODE + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Debug ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.67.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_HIP_ENABLE=ON ALPAKA_ACC_GPU_HIP_ONLY_MODE=ON ALPAKA_CI_HIP_BRANCH="roc-2.7.0" ALPAKA_HIP_PLATFORM=nvcc ALPAKA_CUDA_ARCH="30;35" ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_NVCC_EXPT_RELAXED_CONSTEXPR=OFF ALPAKA_CUDA_NVCC_EXPT_EXTENDED_LAMBDA=OFF + - name: HIP(nvcc9.2) + gcc-5 Release ALPAKA_ACC_GPU_HIP_ONLY_MODE + env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:16.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=5 CMAKE_BUILD_TYPE=Release ALPAKA_CI_STDLIB=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.71.0 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_HIP_ENABLE=ON ALPAKA_ACC_GPU_HIP_ONLY_MODE=ON ALPAKA_CI_HIP_BRANCH="roc-2.7.0" ALPAKA_HIP_PLATFORM=nvcc ALPAKA_CUDA_ARCH="30;35" ALPAKA_CUDA_VERSION=9.2 ALPAKA_CUDA_COMPILER=nvcc + +branches: + except: + - gh-pages + +cache: + directories: + - $ALPAKA_CI_DOCKER_CACHE_DIR + +script: + - set -eovx pipefail + - if [ "$TRAVIS_OS_NAME" = "linux" ] ;then sudo apt-get -y --quiet --allow-unauthenticated --no-install-recommends install smem ;fi + - if [ "$TRAVIS_OS_NAME" = "linux" ] ;then sudo apt-get -y --quiet --allow-unauthenticated --no-install-recommends install moreutils ;fi + - if [ "$TRAVIS_OS_NAME" = "osx" ] ;then brew install moreutils ;fi + - if [ "$TRAVIS_OS_NAME" = "linux" ] || [ "$TRAVIS_OS_NAME" = "osx" ] ;then ./script/travis/script.sh | ts ;fi + - if [ "$TRAVIS_OS_NAME" = "windows" ] ;then ./script/travis/script.sh ;fi + +after_failure: + - ./script/travis/after_failure.sh + +notifications: + email: false diff --git a/alpaka/.zenodo.json b/alpaka/.zenodo.json new file mode 100644 index 0000000000..80d29a6ce4 --- /dev/null +++ b/alpaka/.zenodo.json @@ -0,0 +1,66 @@ +{ + "title": "Alpaka: Abstraction Library for Parallel Kernel Acceleration", + "description": "The alpaka library is a header-only C++11 abstraction library for accelerator development. Its aim is to provide performance portability across accelerators through the abstraction (not hiding!) of the underlying levels of parallelism.", + "creators": [ + { + "affiliation": "LogMeIn, Inc.", + "name": "Worpitz, Benjamin" + }, + { + "affiliation": "Helmholtz-Zentrum Dresden-Rossendorf, TU Dresden", + "name": "Matthes, Alexander", + "orcid": "0000-0002-6702-2015" + }, + { + "affiliation": "LogMeIn, Inc.", + "name": "Zenker, Erik", + "orcid": "0000-0001-9417-8712" + }, + { + "affiliation": "Helmholtz-Zentrum Dresden-Rossendorf, TU Dresden", + "name": "Huebl, Axel", + "orcid": "0000-0003-1943-7141" + }, + { + "affiliation": "Helmholtz-Zentrum Dresden-Rossendorf", + "name": "Widera, René", + "orcid": "0000-0003-1642-0459" + } + ], + "access_right": "open", + "keywords": [ + "HPC", + "CUDA", + "OpenMP", + "C++", + "GPU", + "HIP", + "heterogeneous computing", + "performance portability" + ], + "license": "MPL-2.0", + "upload_type": "software", + "grants": [ + { + "id": "654220" + } + ], + "related_identifiers": [ + { + "identifier": "DOI:10.5281/zenodo.49768", + "relation": "isCitedBy" + }, + { + "identifier": "DOI:10.1007/978-3-319-46079-6_21", + "relation": "cites" + }, + { + "identifier": "DOI:10.1109/IPDPSW.2016.50", + "relation": "isCitedBy" + }, + { + "identifier": "DOI:10.1007/978-3-319-67630-2_36", + "relation": "isCitedBy" + } + ] +} diff --git a/alpaka/CMakeLists.txt b/alpaka/CMakeLists.txt new file mode 100644 index 0000000000..0f7a6c59b5 --- /dev/null +++ b/alpaka/CMakeLists.txt @@ -0,0 +1,46 @@ +# +# Copyright 2015-2019 Benjamin Worpitz +# +# This file is part of alpaka. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +################################################################################ +# Required CMake version + +cmake_minimum_required(VERSION 3.11.4) + +project("alpakaAll") + +SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) + +################################################################################ +# CMake policies +# +# Search in _ROOT: +# https://cmake.org/cmake/help/v3.12/policy/CMP0074.html + +if(POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) +endif() + +################################################################################ +# Options and Variants + +option(alpaka_BUILD_EXAMPLES "Build the examples" ON) + +include(CTest) +# automatically defines: BUILD_TESTING, default is ON + +################################################################################ +# Add subdirectories + +if(alpaka_BUILD_EXAMPLES) + add_subdirectory("example/") +endif() +if(BUILD_TESTING) + add_subdirectory("test/") +endif() diff --git a/alpaka/Findalpaka.cmake b/alpaka/Findalpaka.cmake new file mode 100644 index 0000000000..94d0187356 --- /dev/null +++ b/alpaka/Findalpaka.cmake @@ -0,0 +1,109 @@ +#.rst: +# Findalpaka +# ---------- +# +# Abstraction library for parallel kernel acceleration +# https://github.com/ComputationalRadiationPhysics/alpaka +# +# Finding and Using alpaka +# ^^^^^^^^^^^^^^^^^^^^^ +# +# .. code-block:: cmake +# +# FIND_PACKAGE(alpaka +# [version] [EXACT] # Minimum or EXACT version, e.g. 1.0.0 +# [REQUIRED] # Fail with an error if alpaka or a required +# # component is not found +# [QUIET] # Do not warn if this module was not found +# [COMPONENTS <...>] # Compiled in components: ignored +# ) +# TARGET_LINK_LIBRARIES( PUBLIC alpaka) +# +# To provide a hint to this module where to find the alpaka installation, +# set the ALPAKA_ROOT variable. +# +# This module requires Boost. Make sure to provide a valid install of it +# under the environment variable BOOST_ROOT. +# +# ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE will require Boost.Fiber to be built. +# ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE and ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE will require a OpenMP 2.0+ capable compiler. +# ALPAKA_ACC_CPU_BT_OMP4_ENABLE will require a OpenMP 4.0+ capable compiler. +# ALPAKA_ACC_GPU_CUDA_ENABLE will require CUDA 8.0+ to be installed. +# ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE will require TBB 2.2+ to be installed +# +# Set the following CMake variables BEFORE calling find_packages to +# change the behaviour of this module: +# - ``ALPAKA_ACC_GPU_CUDA_ONLY_MODE`` {ON, OFF} +# - ``ALPAKA_ACC_GPU_HIP_ONLY_MODE`` {ON, OFF} +# - ``ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_CPU_BT_OMP4_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_GPU_CUDA_ENABLE`` {ON, OFF} +# - ``ALPAKA_ACC_GPU_HIP_ENABLE`` {ON, OFF} +# - ``ALPAKA_CUDA_VERSION`` {8.0, ...} +# - ``ALPAKA_CUDA_ARCH`` {sm_20, sm...} +# - ``ALPAKA_CUDA_FAST_MATH`` {ON, OFF} +# - ``ALPAKA_CUDA_FTZ`` {ON, OFF} +# - ``ALPAKA_CUDA_SHOW_REGISTER`` {ON, OFF} +# - ``ALPAKA_CUDA_KEEP_FILES`` {ON, OFF} +# - ``ALPAKA_CUDA_SHOW_CODELINES`` {ON, OFF} +# - ``ALPAKA_DEBUG`` {0, 1, 2} +# - ``ALPAKA_CXX_STANDARD`` {11, 14, 17} +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# - ``alpaka_FOUND`` +# TRUE if alpaka found a working install. +# - ``alpaka_VERSION`` +# Version in format Major.Minor.Patch +# - ``alpaka_COMPILE_OPTIONS`` +# Compiler options. +# - ``alpaka_COMPILE_DEFINITIONS`` +# Compiler definitions (without "-D" prefix!). +# - ``alpaka_DEFINITIONS`` +# Deprecated old compiler definitions. Combination of alpaka_COMPILE_OPTIONS and alpaka_COMPILE_DEFINITIONS prefixed with "-D". +# - ``alpaka_INCLUDE_DIRS`` +# Include directories required by the alpaka headers. +# - ``alpaka_LIBRARIES`` +# Libraries required to link against to use alpaka. +# +# +# IMPORTED Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines the :prop_tgt:`IMPORTED` target ``alpaka``, if alpaka has +# been found. +# + + +################################################################################ +# Copyright 2015-2019 Benjamin Worpitz +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE +# USE OR PERFORMANCE OF THIS SOFTWARE. + +FIND_PATH( + _ALPAKA_ROOT_DIR + NAMES "include/alpaka/alpaka.hpp" + HINTS "${ALPAKA_ROOT}" ENV ALPAKA_ROOT + DOC "alpaka ROOT location") + +IF(_ALPAKA_ROOT_DIR) + INCLUDE("${_ALPAKA_ROOT_DIR}/alpakaConfig.cmake") +ELSE() + MESSAGE(FATAL_ERROR "alpaka could not be found!") +ENDIF() diff --git a/alpaka/LICENSE b/alpaka/LICENSE new file mode 100644 index 0000000000..a612ad9813 --- /dev/null +++ b/alpaka/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/alpaka/README.md b/alpaka/README.md new file mode 100644 index 0000000000..dd06b3873d --- /dev/null +++ b/alpaka/README.md @@ -0,0 +1,212 @@ +**alpaka** - Abstraction Library for Parallel Kernel Acceleration +================================================================= + +[![Travis CI Build Status](https://travis-ci.org/ComputationalRadiationPhysics/alpaka.svg?branch=develop)](https://travis-ci.org/ComputationalRadiationPhysics/alpaka) +[![Language](https://img.shields.io/badge/language-C%2B%2B11-orange.svg)](https://isocpp.org/) +[![Platforms](https://img.shields.io/badge/platform-linux%20%7C%20windows%20%7C%20mac-lightgrey.svg)](https://github.com/ComputationalRadiationPhysics/alpaka) +[![License](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](https://www.mozilla.org/en-US/MPL/2.0/) + +![Alpaka](doc/images/alpaka_401x135.png) + +The **alpaka** library is a header-only C++11 abstraction library for accelerator development. + +Its aim is to provide performance portability across accelerators through the abstraction (not hiding!) of the underlying levels of parallelism. + +It is platform independent and supports the concurrent and cooperative use of multiple devices such as the hosts CPU as well as attached accelerators as for instance CUDA GPUs and Xeon Phis (currently native execution only). +A multitude of accelerator back-end variants using CUDA, OpenMP (2.0/4.0), Boost.Fiber, std::thread and also serial execution is provided and can be selected depending on the device. +Only one implementation of the user kernel is required by representing them as function objects with a special interface. +There is no need to write special CUDA, OpenMP or custom threading code. +Accelerator back-ends can be mixed within a device queue. +The decision which accelerator back-end executes which kernel can be made at runtime. + +The **alpaka** API is currently unstable (beta state). + +The abstraction used is very similar to the CUDA grid-blocks-threads division strategy. +Algorithms that should be parallelized have to be divided into a multi-dimensional grid consisting of small uniform work items. +These functions are called kernels and are executed in parallel threads. +The threads in the grid are organized in blocks. +All threads in a block are executed in parallel and can interact via fast shared memory. +Blocks are executed independently and can not interact in any way. +The block execution order is unspecified and depends on the accelerator in use. +By using this abstraction the execution can be optimally adapted to the available hardware. + + +Software License +---------------- + +**alpaka** is licensed under **MPL-2.0**. + + +Documentation +------------- + +The [general documentation](doc/markdown/Index.md) is located within the `doc/markdown` subfolder of the repository. +The [source code documentation](http://computationalradiationphysics.github.io/alpaka/) is generated with [doxygen](http://www.doxygen.org). + + +Accelerator Back-ends +--------------------- + +|Accelerator Back-end|Lib/API|Devices|Execution strategy grid-blocks|Execution strategy block-threads| +|---|---|---|---|---| +|Serial|n/a|Host CPU (single core)|sequential|sequential (only 1 thread per block)| +|OpenMP 2.0+ blocks|OpenMP 2.0+|Host CPU (multi core)|parallel (preemptive multitasking)|sequential (only 1 thread per block)| +|OpenMP 2.0+ threads|OpenMP 2.0+|Host CPU (multi core)|sequential|parallel (preemptive multitasking)| +|OpenMP 4.0+ (CPU)|OpenMP 4.0+|Host CPU (multi core)|parallel (undefined)|parallel (preemptive multitasking)| +| std::thread | std::thread |Host CPU (multi core)|sequential|parallel (preemptive multitasking)| +| Boost.Fiber | boost::fibers::fiber |Host CPU (single core)|sequential|parallel (cooperative multitasking)| +|TBB|TBB 2.2+|Host CPU (multi core)|parallel (preemptive multitasking)|sequential (only 1 thread per block)| +|CUDA|CUDA 8.0-10.0|NVIDIA GPUs|parallel (undefined)|parallel (lock-step within warps)| +|HIP(nvcc)|[HIP 1.5+](https://github.com/ROCm-Developer-Tools/HIP)|NVIDIA GPUs SM 2.0+|parallel (undefined)|parallel (lock-step within warps)| + + +Supported Compilers +------------------- + +This library uses C++11 (or newer when available). + +|Accelerator Back-end|gcc 4.9.4
(Linux)|gcc 5.5
(Linux)|gcc 6.4/7.3
(Linux)|gcc 8.1/9.1
(Linux)|clang 4
(Linux)|clang 5
(Linux)|clang 6
(Linux)|clang 7
(Linux)|clang 8
(Linux)|clang 9
(Linux)|Apple LLVM 10.2-11.2
(macOS)|MSVC 2017.9
(Windows)| +|---|---|---|---|---|---|---|---|---|---|---|---| +|Serial|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:| +|OpenMP 2.0+ blocks|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:x:|:white_check_mark:| +|OpenMP 2.0+ threads|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:x:|:white_check_mark:| +|OpenMP 4.0+ (CPU)|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:x:|:x:| +| std::thread |:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:| +| Boost.Fiber |:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:x:|:white_check_mark:| +|TBB|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:|:white_check_mark:| +|CUDA (nvcc)|:white_check_mark:
(CUDA 8.0-10.1)|:white_check_mark:
(CUDA 9.0-10.1)|:white_check_mark:
(CUDA 9.2-10.1) |:x:|:white_check_mark:
(CUDA 9.1-10.1)|:white_check_mark:
(CUDA 10.1)|:white_check_mark:
(CUDA 10.1)|:white_check_mark:
(CUDA 10.1)|:white_check_mark:
(CUDA 10.1)|:x:|:x:|:white_check_mark:
(CUDA 10.0-10.1)| +|CUDA (clang) | - | - | - | - | :white_check_mark:
(CUDA 8.0)| :white_check_mark:
(CUDA 8.0)| :white_check_mark:
(CUDA 8.0-9.0) | :white_check_mark:
(CUDA 8.0-9.2) | :white_check_mark:
(CUDA 8.0-10.0) | :white_check_mark:
(CUDA 9.2-10.1) | - | - | +|[HIP](doc/markdown/user/implementation/mapping/HIP.md) (nvcc)|:white_check_mark:
(nvcc 9.0+)|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:| + + +Other compilers or combinations marked with :x: in the table above may work but are not tested in CI and are therefore not explicitly supported. + +Dependencies +------------ + +[Boost](https://boost.org/) 1.62+ is the only mandatory external dependency (for CUDA 9+ Boost >=1.65.1 is required). +The **alpaka** library itself just requires header-only libraries. +However some of the accelerator back-end implementations require different boost libraries to be built. + +When an accelerator back-end using *Boost.Fiber* is enabled, `boost-fiber` and all of its dependencies are required to be built in C++11 mode `./b2 cxxflags="-std=c++11"`. +When *Boost.Fiber* is enabled and alpaka is built in C++17 mode with clang and libstc++, Boost >= 1.67.0 is required. + +When an accelerator back-end using *CUDA* is enabled, version *8.0* of the *CUDA SDK* is the minimum requirement. +*NOTE*: When using nvcc as *CUDA* compiler, the *CUDA accelerator back-end* can not be enabled together with the *Boost.Fiber accelerator back-end* due to bugs in the nvcc compiler. +*NOTE*: When using clang as a native *CUDA* compiler, the *CUDA accelerator back-end* can not be enabled together with any *OpenMP accelerator back-end* because this combination is currently unsupported. +*NOTE*: Separable compilation is only supported when using nvcc, not with clang as native *CUDA* compiler. It is disabled by default and can be enabled via the CMake flag `ALPAKA_CUDA_NVCC_SEPARABLE_COMPILATION`. + +When an accelerator back-end using *OpenMP* is enabled, the compiler and the platform have to support the corresponding minimum *OpenMP* version. + +When an accelerator back-end using *TBB* is enabled, the compiler and the platform have to support the corresponding minimum *TBB* version. + + +Usage +----- + +The library is header only so nothing has to be built. +CMake 3.11.4+ is required to provide the correct defines and include paths. +Just call `ALPAKA_ADD_EXECUTABLE` instead of `CUDA_ADD_EXECUTABLE` or `ADD_EXECUTABLE` and the difficulties of the CUDA nvcc compiler in handling `.cu` and `.cpp` files are automatically taken care of. +Source files do not need any special file ending. +Examples of how to utilize alpaka within CMake can be found in the `example` folder. + +The whole alpaka library can be included with: `#include ` +Code that is not intended to be utilized by the user is hidden in the `detail` namespace. + + +Introduction +------------ + +For a quick introduction, feel free to playback the recording of our presentation at +[GTC 2016](http://mygtc.gputechconf.com/quicklink/858sI36): + + - E. Zenker, R. Widera, G. Juckeland et al., + *Porting the Plasma Simulation PIConGPU to Heterogeneous Architectures with Alpaka*, + [video link (39 min)](http://on-demand.gputechconf.com/gtc/2016/video/S6298.html) + + +Citing alpaka +------------- + +Currently all authors of **alpaka** are scientists or connected with +research. For us to justify the importance and impact of our work, please +consider citing us accordingly in your derived work and publications: + +```latex +% Peer-Reviewed Publication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Peer reviewed and accepted publication in +% "2nd International Workshop on Performance Portable +% Programming Models for Accelerators (P^3MA)" +% colocated with the +% "2017 ISC High Performance Conference" +% in Frankfurt, Germany +@inproceedings{MathesP3MA2017, + author = {{Matthes}, A. and {Widera}, R. and {Zenker}, E. and {Worpitz}, B. and + {Huebl}, A. and {Bussmann}, M.}, + title = {Tuning and optimization for a variety of many-core architectures without changing a single line of implementation code + using the Alpaka library}, + archivePrefix = "arXiv", + eprint = {1706.10086}, + keywords = {Computer Science - Distributed, Parallel, and Cluster Computing}, + day = {30}, + month = {Jun}, + year = {2017}, + url = {https://arxiv.org/abs/1706.10086}, +} + +% Peer-Reviewed Publication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Peer reviewed and accepted publication in +% "The Sixth International Workshop on +% Accelerators and Hybrid Exascale Systems (AsHES)" +% at the +% "30th IEEE International Parallel and Distributed +% Processing Symposium" in Chicago, IL, USA +@inproceedings{ZenkerAsHES2016, + author = {Erik Zenker and Benjamin Worpitz and Ren{\'{e}} Widera + and Axel Huebl and Guido Juckeland and + Andreas Kn{\"{u}}pfer and Wolfgang E. Nagel and Michael Bussmann}, + title = {Alpaka - An Abstraction Library for Parallel Kernel Acceleration}, + archivePrefix = "arXiv", + eprint = {1602.08477}, + keywords = {Computer science;CUDA;Mathematical Software;nVidia;OpenMP;Package; + performance portability;Portability;Tesla K20;Tesla K80}, + day = {23}, + month = {May}, + year = {2016}, + publisher = {IEEE Computer Society}, + url = {http://arxiv.org/abs/1602.08477}, +} + + +% Original Work: Benjamin Worpitz' Master Thesis %%%%%%%%%% +% +@MasterThesis{Worpitz2015, + author = {Benjamin Worpitz}, + title = {Investigating performance portability of a highly scalable + particle-in-cell simulation code on various multi-core + architectures}, + school = {{Technische Universit{\"{a}}t Dresden}}, + month = {Sep}, + year = {2015}, + type = {Master Thesis}, + doi = {10.5281/zenodo.49768}, + url = {http://dx.doi.org/10.5281/zenodo.49768} +} +``` + + +Authors +------- + +### Maintainers and Core Developers + +- Benjamin Worpitz (original author) +- Rene Widera + +### Former Members, Contributions and Thanks + +- Dr. Michael Bussmann +- Axel Huebl +- Erik Zenker diff --git a/alpaka/alpakaConfig.cmake b/alpaka/alpakaConfig.cmake new file mode 100644 index 0000000000..67302510d4 --- /dev/null +++ b/alpaka/alpakaConfig.cmake @@ -0,0 +1,1193 @@ +# +# Copyright 2014-2019 Benjamin Worpitz, Erik Zenker, Axel Huebl +# +# This file is part of Alpaka. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +################################################################################ +# Required cmake version. + +CMAKE_MINIMUM_REQUIRED(VERSION 3.11.4) + +################################################################################ +# CMake policies +# +# Search in _ROOT: +# https://cmake.org/cmake/help/v3.12/policy/CMP0074.html + +if(POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) +endif() + +################################################################################ +# alpaka. + +# Return values. +UNSET(alpaka_FOUND) +UNSET(alpaka_VERSION) +UNSET(alpaka_COMPILE_OPTIONS) +UNSET(alpaka_COMPILE_DEFINITIONS) +UNSET(alpaka_DEFINITIONS) +UNSET(alpaka_INCLUDE_DIR) +UNSET(alpaka_INCLUDE_DIRS) +UNSET(alpaka_LIBRARY) +UNSET(alpaka_LIBRARIES) + +# Internal usage. +UNSET(_ALPAKA_FOUND) +UNSET(_ALPAKA_COMPILE_OPTIONS_PUBLIC) +UNSET(_ALPAKA_COMPILE_DEFINITIONS_PUBLIC) +UNSET(_ALPAKA_INCLUDE_DIRECTORY) +UNSET(_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC) +UNSET(_ALPAKA_LINK_LIBRARIES_PUBLIC) +UNSET(_ALPAKA_LINK_FLAGS_PUBLIC) +UNSET(_ALPAKA_COMMON_FILE) +UNSET(_ALPAKA_ADD_EXECUTABLE_FILE) +UNSET(_ALPAKA_ADD_LIBRRAY_FILE) +UNSET(_ALPAKA_FILES_HEADER) +UNSET(_ALPAKA_FILES_OTHER) + +#------------------------------------------------------------------------------- +# Common. + +# Directory of this file. +SET(_ALPAKA_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}) +# Normalize the path (e.g. remove ../) +GET_FILENAME_COMPONENT(_ALPAKA_ROOT_DIR "${_ALPAKA_ROOT_DIR}" ABSOLUTE) + +# Add common functions. +SET(_ALPAKA_COMMON_FILE "${_ALPAKA_ROOT_DIR}/cmake/common.cmake") +INCLUDE("${_ALPAKA_COMMON_FILE}") + +# Add ALPAKA_ADD_EXECUTABLE function. +SET(_ALPAKA_ADD_EXECUTABLE_FILE "${_ALPAKA_ROOT_DIR}/cmake/addExecutable.cmake") +INCLUDE("${_ALPAKA_ADD_EXECUTABLE_FILE}") + +# Add ALPAKA_ADD_LIBRARY function. +SET(_ALPAKA_ADD_LIBRARY_FILE "${_ALPAKA_ROOT_DIR}/cmake/addLibrary.cmake") +INCLUDE("${_ALPAKA_ADD_LIBRARY_FILE}") + +# Set found to true initially and set it to false if a required dependency is missing. +SET(_ALPAKA_FOUND TRUE) + +# Add module search path +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_ALPAKA_ROOT_DIR}/cmake/modules/") + +#------------------------------------------------------------------------------- +# Options. +SET(ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE_DEFAULT ON) +SET(ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE_DEFAULT ON) +SET(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE_DEFAULT ON) +SET(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE_DEFAULT ON) +SET(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE_DEFAULT ON) +SET(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE_DEFAULT ON) +SET(ALPAKA_ACC_CPU_BT_OMP4_ENABLE_DEFAULT ON) + +# HIP and platform selection and warning about unsupported features +OPTION(ALPAKA_ACC_GPU_HIP_ENABLE "Enable the HIP back-end (all other back-ends must be disabled)" OFF) +OPTION(ALPAKA_ACC_GPU_HIP_ONLY_MODE "Only back-ends using HIP can be enabled in this mode." OFF) # HIP only runs without other back-ends + +# Drop-down combo box in cmake-gui for HIP platforms. +SET(ALPAKA_HIP_PLATFORM "nvcc" CACHE STRING "Specify HIP platform") +SET_PROPERTY(CACHE ALPAKA_HIP_PLATFORM PROPERTY STRINGS "nvcc;hcc") + +IF(ALPAKA_ACC_GPU_HIP_ENABLE AND NOT ALPAKA_ACC_GPU_HIP_ONLY_MODE) + MESSAGE(WARNING "HIP back-end must be used together with ALPAKA_ACC_GPU_HIP_ONLY_MODE") + SET(ALPAKA_ACC_GPU_HIP_ENABLE OFF CACHE BOOL "" FORCE) +ENDIF() + +IF(ALPAKA_ACC_GPU_HIP_ENABLE AND ALPAKA_HIP_PLATFORM MATCHES "hcc") + MESSAGE(WARNING + "The HIP back-end is currently experimental, especially for HCC. " + "In alpaka HIP(HCC) has a few workarounds and does not support 3D memory and constant memory. " + ) +ENDIF() + +OPTION(ALPAKA_ACC_GPU_CUDA_ONLY_MODE "Only back-ends using CUDA can be enabled in this mode (This allows to mix alpaka code with native CUDA code)." OFF) +# If CUDA-only mode is enabled, we set the defaults for all CPU back-ends to OFF. +# If they are explicitly set via the command line, the user will get an error later on. +IF(ALPAKA_ACC_GPU_CUDA_ONLY_MODE OR ALPAKA_ACC_GPU_HIP_ONLY_MODE) # CUDA-only or HIP-only + SET(ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_BT_OMP4_ENABLE_DEFAULT OFF) +ENDIF() + +OPTION(ALPAKA_ACC_GPU_CUDA_ENABLE "Enable the CUDA GPU back-end" ON) + +# If CUDA is enabled, we set the defaults for some unsupported back-ends to OFF. +# If they are explicitly set via the command line, the user will get an error later on. +IF(ALPAKA_ACC_GPU_CUDA_ENABLE) + SET(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE_DEFAULT OFF) + IF(ALPAKA_CUDA_COMPILER MATCHES "clang") + SET(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE_DEFAULT OFF) + SET(ALPAKA_ACC_CPU_BT_OMP4_ENABLE_DEFAULT OFF) + ENDIF() +ENDIF() + +IF(ALPAKA_ACC_GPU_CUDA_ONLY_MODE AND NOT ALPAKA_ACC_GPU_CUDA_ENABLE) + MESSAGE(WARNING "If ALPAKA_ACC_GPU_CUDA_ONLY_MODE is enabled, ALPAKA_ACC_GPU_CUDA_ENABLE has to be enabled as well.") + SET(_ALPAKA_FOUND FALSE) +ENDIF() +IF(ALPAKA_ACC_GPU_HIP_ONLY_MODE AND NOT ALPAKA_ACC_GPU_HIP_ENABLE) + MESSAGE(WARNING "If ALPAKA_ACC_GPU_HIP_ONLY_MODE is enabled, ALPAKA_ACC_GPU_HIP_ENABLE has to be enabled as well.") + SET(_ALPAKA_FOUND FALSE) +ENDIF() + + +OPTION(ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE "Enable the serial CPU back-end" ${ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE_DEFAULT}) +OPTION(ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE "Enable the threads CPU block thread back-end" ${ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE_DEFAULT}) +OPTION(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE "Enable the fibers CPU block thread back-end" ${ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE_DEFAULT}) +OPTION(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE "Enable the TBB CPU grid block back-end" ${ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE_DEFAULT}) +OPTION(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE "Enable the OpenMP 2.0 CPU grid block back-end" ${ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE_DEFAULT}) +OPTION(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE "Enable the OpenMP 2.0 CPU block thread back-end" ${ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE_DEFAULT}) +OPTION(ALPAKA_ACC_CPU_BT_OMP4_ENABLE "Enable the OpenMP 4.0 CPU block and block thread back-end" ${ALPAKA_ACC_CPU_BT_OMP4_ENABLE_DEFAULT}) + +IF((ALPAKA_ACC_GPU_CUDA_ONLY_MODE OR ALPAKA_ACC_GPU_HIP_ONLY_MODE) + AND + (ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE OR + ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE OR + ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE OR + ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE OR + ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE OR + ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE OR + ALPAKA_ACC_CPU_BT_OMP4_ENABLE)) + IF(ALPAKA_ACC_GPU_CUDA_ONLY_MODE) + MESSAGE(WARNING "If ALPAKA_ACC_GPU_CUDA_ONLY_MODE is enabled, only back-ends using CUDA can be enabled! This allows to mix alpaka code with native CUDA code. However, this prevents any non-CUDA back-ends from being enabled.") + ENDIF() + IF(ALPAKA_ACC_GPU_HIP_ONLY_MODE) + MESSAGE(WARNING "If ALPAKA_ACC_GPU_HIP_ONLY_MODE is enabled, only back-ends using HIP can be enabled!") + ENDIF() + SET(_ALPAKA_FOUND FALSE) +ENDIF() + +# avoids CUDA+HIP conflict +IF(ALPAKA_ACC_GPU_HIP_ENABLE AND ALPAKA_ACC_GPU_CUDA_ENABLE) + MESSAGE(FATAL_ERROR "CUDA and HIP can not be enabled both at the same time.") +ENDIF() + +# HIP is only supported on Linux +IF(ALPAKA_ACC_GPU_HIP_ENABLE AND (MSVC OR WIN32)) + MESSAGE(WARNING "Optional alpaka dependency HIP can not be built on Windows! HIP back-end disabled!") + SET(ALPAKA_ACC_GPU_HIP_ENABLE OFF CACHE BOOL "Enable the HIP GPU back-end" FORCE) +ENDIF() + +# Drop-down combo box in cmake-gui. +SET(ALPAKA_DEBUG "0" CACHE STRING "Debug level") +SET_PROPERTY(CACHE ALPAKA_DEBUG PROPERTY STRINGS "0;1;2") + +SET(ALPAKA_CXX_STANDARD "11" CACHE STRING "C++ standard version") +SET_PROPERTY(CACHE ALPAKA_CXX_STANDARD PROPERTY STRINGS "11;14;17") + +#------------------------------------------------------------------------------- +# Debug output of common variables. +IF(${ALPAKA_DEBUG} GREATER 1) + MESSAGE(STATUS "_ALPAKA_ROOT_DIR : ${_ALPAKA_ROOT_DIR}") + MESSAGE(STATUS "_ALPAKA_COMMON_FILE : ${_ALPAKA_COMMON_FILE}") + MESSAGE(STATUS "_ALPAKA_ADD_EXECUTABLE_FILE : ${_ALPAKA_ADD_EXECUTABLE_FILE}") + MESSAGE(STATUS "_ALPAKA_ADD_LIBRARY_FILE : ${_ALPAKA_ADD_LIBRARY_FILE}") + MESSAGE(STATUS "CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}") +ENDIF() + +#------------------------------------------------------------------------------- +# Check supported compilers. +IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) + MESSAGE(FATAL_ERROR "Clang versions < 4.0 are not supported!") + SET(_ALPAKA_FOUND FALSE) +ENDIF() + +IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE AND (ALPAKA_ACC_GPU_CUDA_ENABLE OR ALPAKA_ACC_GPU_HIP_ENABLE)) + MESSAGE(FATAL_ERROR "Fibers and CUDA or HIP back-end can not be enabled both at the same time.") + SET(_ALPAKA_FOUND FALSE) +ENDIF() + +#------------------------------------------------------------------------------- +# Compiler settings. +IF(MSVC) + # Empty append to define it if it does not already exist. + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC) + + IF(ALPAKA_ACC_GPU_CUDA_ONLY_MODE) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "/wd4505") # CUDA\v9.2\include\crt/host_runtime.h(265): warning C4505: '__cudaUnregisterBinaryUtil': unreferenced local function has been removed + ENDIF() +ELSE() + # Add linker options. + # lipthread: + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC "general;pthread") + IF(NOT APPLE) + # librt: undefined reference to `clock_gettime' + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC "general;rt") + ENDIF() + + # Clang<4.0 or AppleClang<9.0 + # https://bugs.llvm.org/show_bug.cgi?id=18417 + # https://github.com/llvm/llvm-project/commit/e55b4737c026ea2e0b44829e4115d208577a67b2 + IF(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) OR + ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-ftemplate-depth=1024") + ENDIF() +ENDIF() + +#------------------------------------------------------------------------------- +# Find Boost. +SET(_ALPAKA_BOOST_MIN_VER "1.62.0") +IF(${ALPAKA_DEBUG} GREATER 1) + SET(Boost_DEBUG ON) + SET(Boost_DETAILED_FAILURE_MSG ON) +ENDIF() +IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE) + FIND_PACKAGE(Boost ${_ALPAKA_BOOST_MIN_VER} QUIET COMPONENTS fiber context system thread atomic chrono date_time) + IF(NOT Boost_FIBER_FOUND) + MESSAGE(STATUS "Optional alpaka dependency Boost fiber could not be found! Fibers back-end disabled!") + SET(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE OFF CACHE BOOL "Enable the Fibers CPU back-end" FORCE) + FIND_PACKAGE(Boost ${_ALPAKA_BOOST_MIN_VER} QUIET) + ELSE() + # On Win32 boost context triggers: + # libboost_context-vc141-mt-gd-1_64.lib(jump_i386_ms_pe_masm.obj) : error LNK2026: module unsafe for SAFESEH image. + IF(MSVC) + IF(CMAKE_SIZEOF_VOID_P EQUAL 4) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") + ENDIF() + ENDIF() + ENDIF() + +ELSE() + FIND_PACKAGE(Boost ${_ALPAKA_BOOST_MIN_VER} QUIET) +ENDIF() + +IF(${ALPAKA_DEBUG} GREATER 1) + MESSAGE(STATUS "Boost in:") + MESSAGE(STATUS "BOOST_ROOT : ${BOOST_ROOT}") + MESSAGE(STATUS "BOOSTROOT : ${BOOSTROOT}") + MESSAGE(STATUS "BOOST_INCLUDEDIR: ${BOOST_INCLUDEDIR}") + MESSAGE(STATUS "BOOST_LIBRARYDIR: ${BOOST_LIBRARYDIR}") + MESSAGE(STATUS "Boost_NO_SYSTEM_PATHS: ${Boost_NO_SYSTEM_PATHS}") + MESSAGE(STATUS "Boost_ADDITIONAL_VERSIONS: ${Boost_ADDITIONAL_VERSIONS}") + MESSAGE(STATUS "Boost_USE_MULTITHREADED: ${Boost_USE_MULTITHREADED}") + MESSAGE(STATUS "Boost_USE_STATIC_LIBS: ${Boost_USE_STATIC_LIBS}") + MESSAGE(STATUS "Boost_USE_STATIC_RUNTIME: ${Boost_USE_STATIC_RUNTIME}") + MESSAGE(STATUS "Boost_USE_DEBUG_RUNTIME: ${Boost_USE_DEBUG_RUNTIME}") + MESSAGE(STATUS "Boost_USE_DEBUG_PYTHON: ${Boost_USE_DEBUG_PYTHON}") + MESSAGE(STATUS "Boost_USE_STLPORT: ${Boost_USE_STLPORT}") + MESSAGE(STATUS "Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS: ${Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS}") + MESSAGE(STATUS "Boost_COMPILER: ${Boost_COMPILER}") + MESSAGE(STATUS "Boost_THREADAPI: ${Boost_THREADAPI}") + MESSAGE(STATUS "Boost_NAMESPACE: ${Boost_NAMESPACE}") + MESSAGE(STATUS "Boost_DEBUG: ${Boost_DEBUG}") + MESSAGE(STATUS "Boost_DETAILED_FAILURE_MSG: ${Boost_DETAILED_FAILURE_MSG}") + MESSAGE(STATUS "Boost_REALPATH: ${Boost_REALPATH}") + MESSAGE(STATUS "Boost_NO_BOOST_CMAKE: ${Boost_NO_BOOST_CMAKE}") + MESSAGE(STATUS "Boost out:") + MESSAGE(STATUS "Boost_FOUND: ${Boost_FOUND}") + MESSAGE(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}") + MESSAGE(STATUS "Boost_LIBRARY_DIRS: ${Boost_LIBRARY_DIRS}") + MESSAGE(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}") + MESSAGE(STATUS "Boost_FIBER_FOUND: ${Boost_FIBER_FOUND}") + MESSAGE(STATUS "Boost_FIBER_LIBRARY: ${Boost_FIBER_LIBRARY}") + MESSAGE(STATUS "Boost_CONTEXT_FOUND: ${Boost_CONTEXT_FOUND}") + MESSAGE(STATUS "Boost_CONTEXT_LIBRARY: ${Boost_CONTEXT_LIBRARY}") + MESSAGE(STATUS "Boost_SYSTEM_FOUND: ${Boost_SYSTEM_FOUND}") + MESSAGE(STATUS "Boost_SYSTEM_LIBRARY: ${Boost_SYSTEM_LIBRARY}") + MESSAGE(STATUS "Boost_THREAD_FOUND: ${Boost_THREAD_FOUND}") + MESSAGE(STATUS "Boost_THREAD_LIBRARY: ${Boost_THREAD_LIBRARY}") + MESSAGE(STATUS "Boost_ATOMIC_FOUND: ${Boost_ATOMIC_FOUND}") + MESSAGE(STATUS "Boost_ATOMIC_LIBRARY: ${Boost_ATOMIC_LIBRARY}") + MESSAGE(STATUS "Boost_CHRONO_FOUND: ${Boost_CHRONO_FOUND}") + MESSAGE(STATUS "Boost_CHRONO_LIBRARY: ${Boost_CHRONO_LIBRARY}") + MESSAGE(STATUS "Boost_DATE_TIME_FOUND: ${Boost_DATE_TIME_FOUND}") + MESSAGE(STATUS "Boost_DATE_TIME_LIBRARY: ${Boost_DATE_TIME_LIBRARY}") + MESSAGE(STATUS "Boost_VERSION: ${Boost_VERSION}") + MESSAGE(STATUS "Boost_LIB_VERSION: ${Boost_LIB_VERSION}") + MESSAGE(STATUS "Boost_MAJOR_VERSION: ${Boost_MAJOR_VERSION}") + MESSAGE(STATUS "Boost_MINOR_VERSION: ${Boost_MINOR_VERSION}") + MESSAGE(STATUS "Boost_SUBMINOR_VERSION: ${Boost_SUBMINOR_VERSION}") + MESSAGE(STATUS "Boost_LIB_DIAGNOSTIC_DEFINITIONS: ${Boost_LIB_DIAGNOSTIC_DEFINITIONS}") + MESSAGE(STATUS "Boost cached:") + MESSAGE(STATUS "Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}") + MESSAGE(STATUS "Boost_LIBRARY_DIR: ${Boost_LIBRARY_DIR}") +ENDIF() + +IF(NOT Boost_FOUND) + MESSAGE(WARNING "Required alpaka dependency Boost (>=${_ALPAKA_BOOST_MIN_VER}) could not be found!") + SET(_ALPAKA_FOUND FALSE) + +ELSE() + IF(Boost_FIBER_FOUND) + # Boost fiber and default header-only libraries + IF(TARGET Boost::fiber) + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC + Boost::boost + Boost::fiber Boost::context Boost::system Boost::thread + Boost::chrono Boost::date_time Boost::atomic + ) + ELSE() + # fallback: Boost version is too new for CMake + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC ${Boost_INCLUDE_DIRS}) + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC ${Boost_LIBRARIES}) + ENDIF() + ELSE() + # header-only libraries + IF(TARGET Boost::boost) + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC Boost::boost) + ELSE() + # fallback: Boost version is too new for CMake + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC ${Boost_INCLUDE_DIRS}) + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC ${Boost_LIBRARIES}) + ENDIF() + ENDIF() +ENDIF() + +#------------------------------------------------------------------------------- +# Find TBB. +IF(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE) + FIND_PACKAGE(TBB 2.2) + IF(NOT TBB_FOUND) + MESSAGE(STATUS "Optional alpaka dependency TBB could not be found! TBB grid block back-end disabled!") + SET(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE OFF CACHE BOOL "Enable the TBB grid block back-end" FORCE) + ELSE() + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC ${TBB_LIBRARIES}) + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC ${TBB_INCLUDE_DIRS}) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC ${TBB_DEFINITIONS}) + ENDIF() +ENDIF() + +#------------------------------------------------------------------------------- +# Find OpenMP. +IF(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE OR ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE OR ALPAKA_ACC_CPU_BT_OMP4_ENABLE) + FIND_PACKAGE(OpenMP) + + # Manually find OpenMP for the clang compiler if it was not already found. + # Even CMake 3.5 is unable to find libiomp and provide the correct OpenMP flags. + IF(NOT OPENMP_FOUND) + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + FIND_PATH(_ALPAKA_LIBIOMP_INCLUDE_DIR NAMES "omp.h" PATH_SUFFIXES "include" "libiomp" "include/libiomp") + IF(_ALPAKA_LIBIOMP_INCLUDE_DIR) + SET(OPENMP_FOUND TRUE) + SET(OpenMP_CXX_FLAGS "-fopenmp=libiomp5") + SET(OpenMP_C_FLAGS "-fopenmp=libiomp5") + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC "${_ALPAKA_LIBIOMP_INCLUDE_DIR}") + ENDIF() + ENDIF() + ENDIF() + + IF(NOT OPENMP_FOUND) + MESSAGE(STATUS "Optional alpaka dependency OpenMP could not be found! OpenMP back-ends disabled!") + SET(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE OFF CACHE BOOL "Enable the OpenMP 2.0 CPU grid block back-end" FORCE) + SET(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE OFF CACHE BOOL "Enable the OpenMP 2.0 CPU block thread back-end" FORCE) + SET(ALPAKA_ACC_CPU_BT_OMP4_ENABLE OFF CACHE BOOL "Enable the OpenMP 4.0 CPU block and thread back-end" FORCE) + + ELSE() + + # Check whether OpenMP 4 is supported + IF(OpenMP_CXX_VERSION VERSION_LESS 4.0) + SET(ALPAKA_ACC_CPU_BT_OMP4_ENABLE OFF CACHE BOOL "Enable the OpenMP 4.0 CPU block and thread back-end" FORCE) + ENDIF() + + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC ${OpenMP_CXX_FLAGS}) + IF(NOT MSVC) + LIST(APPEND _ALPAKA_LINK_FLAGS_PUBLIC ${OpenMP_CXX_FLAGS}) + ENDIF() + + # clang versions beginning with 3.9 support OpenMP 4.0 but only when given the corresponding flag + IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + IF(ALPAKA_ACC_CPU_BT_OMP4_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-fopenmp-version=40") + ENDIF() + ENDIF() + ENDIF() +ENDIF() + +#------------------------------------------------------------------------------- +# Find CUDA. +IF(ALPAKA_ACC_GPU_CUDA_ENABLE) + + IF(NOT DEFINED ALPAKA_CUDA_VERSION) + SET(ALPAKA_CUDA_VERSION 8.0) + ENDIF() + + IF(ALPAKA_CUDA_VERSION VERSION_LESS 8.0) + MESSAGE(WARNING "CUDA Toolkit < 8.0 is not supported!") + SET(_ALPAKA_FOUND FALSE) + + ELSE() + FIND_PACKAGE(CUDA "${ALPAKA_CUDA_VERSION}") + IF(NOT CUDA_FOUND) + MESSAGE(STATUS "Optional alpaka dependency CUDA could not be found! CUDA back-end disabled!") + SET(ALPAKA_ACC_GPU_CUDA_ENABLE OFF CACHE BOOL "Enable the CUDA GPU back-end" FORCE) + + ELSE() + SET(ALPAKA_CUDA_VERSION "${CUDA_VERSION}") + IF(CUDA_VERSION VERSION_LESS 9.0) + SET(ALPAKA_CUDA_ARCH "20" CACHE STRING "GPU architecture") + ELSE() + SET(ALPAKA_CUDA_ARCH "30" CACHE STRING "GPU architecture") + ENDIF() + SET(ALPAKA_CUDA_COMPILER "nvcc" CACHE STRING "CUDA compiler") + SET_PROPERTY(CACHE ALPAKA_CUDA_COMPILER PROPERTY STRINGS "nvcc;clang") + + OPTION(ALPAKA_CUDA_FAST_MATH "Enable fast-math" ON) + OPTION(ALPAKA_CUDA_FTZ "Set flush to zero for GPU" OFF) + OPTION(ALPAKA_CUDA_SHOW_REGISTER "Show kernel registers and create PTX" OFF) + OPTION(ALPAKA_CUDA_KEEP_FILES "Keep all intermediate files that are generated during internal compilation steps (folder: nvcc_tmp)" OFF) + OPTION(ALPAKA_CUDA_NVCC_EXPT_EXTENDED_LAMBDA "Enable experimental, extended host-device lambdas in NVCC" ON) + OPTION(ALPAKA_CUDA_NVCC_EXPT_RELAXED_CONSTEXPR "Enable experimental, relaxed constexpr in NVCC" ON) + OPTION(ALPAKA_CUDA_NVCC_SEPARABLE_COMPILATION "Enable separable compilation in NVCC" OFF) + + IF(ALPAKA_CUDA_COMPILER MATCHES "clang") + IF(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + MESSAGE(FATAL_ERROR "Using clang as CUDA compiler is only possible if clang is the host compiler!") + ENDIF() + + IF(CMAKE_CXX_COMPILER_VERSION LESS 6.0) + IF(CUDA_VERSION GREATER_EQUAL 9.0) + MESSAGE(FATAL_ERROR "Clang versions lower than 6 do not support CUDA 9 or greater!") + ENDIF() + ELSEIF(CMAKE_CXX_COMPILER_VERSION LESS 7.0) + IF(CUDA_VERSION GREATER_EQUAL 9.1) + MESSAGE(FATAL_ERROR "Clang versions lower than 7 do not support CUDA 9.1 or greater!") + ENDIF() + ELSEIF(CMAKE_CXX_COMPILER_VERSION LESS 8.0) + IF(CUDA_VERSION GREATER_EQUAL 10.0) + MESSAGE(FATAL_ERROR "Clang versions lower than 8 do not support CUDA 10.0 or greater!") + ENDIF() + ELSEIF(CMAKE_CXX_COMPILER_VERSION LESS 9.0) + IF(CUDA_VERSION GREATER_EQUAL 10.1) + MESSAGE(FATAL_ERROR "Clang versions lower than 9 do not support CUDA 10.1 or greater!") + ENDIF() + ENDIF() + + IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE) + MESSAGE(FATAL_ERROR "Clang as a CUDA compiler does not support boost.fiber!") + ENDIF() + IF(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE OR ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE) + MESSAGE(FATAL_ERROR "Clang as a CUDA compiler does not support OpenMP 2!") + ENDIF() + IF(ALPAKA_ACC_CPU_BT_OMP4_ENABLE) + MESSAGE(FATAL_ERROR "Clang as a CUDA compiler does not support OpenMP 4!") + ENDIF() + + FOREACH(_CUDA_ARCH_ELEM ${ALPAKA_CUDA_ARCH}) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "--cuda-gpu-arch=sm_${_CUDA_ARCH_ELEM}") + ENDFOREACH() + + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "--cuda-path=${CUDA_TOOLKIT_ROOT_DIR}") + + # This flag silences the warning produced by the Dummy.cpp files: + # clang: warning: argument unused during compilation: '--cuda-gpu-arch=sm_XX' + # This seems to be a false positive as all flags are 'unused' for an empty file. + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-Qunused-arguments") + + # Silences warnings that are produced by boost because clang is not correctly identified. + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-Wno-unused-local-typedef") + + IF(ALPAKA_CUDA_FAST_MATH) + # -ffp-contract=fast enables the usage of FMA + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-ffast-math" "-ffp-contract=fast") + ENDIF() + + IF(ALPAKA_CUDA_FTZ) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-fcuda-flush-denormals-to-zero") + ENDIF() + + IF(ALPAKA_CUDA_SHOW_REGISTER) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-Xcuda-ptxas=-v") + ENDIF() + + IF(ALPAKA_CUDA_KEEP_FILES) + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-save-temps") + ENDIF() + + # When libstdc++ is used and -std=gnu++XX is set, we get the following compile error: + # /usr/lib/gcc/x86_64-linux-gnu/5.5.0/../../../../include/c++/5.5.0/type_traits:311:39: error: __float128 is not supported on this target struct __is_floating_point_helper<__float128> + # Clang doesn't support the __float128 type (at least when building CUDA device code) + # * Due to the minimum requirement to compile with C++11 and because extensions are enabled by default by CMake, it adds -std=gnu++11 instead of -std=c++11 to the command line. + # Due to alpaka being an INTERFACE library (header-only) we are not allowed to set CXX_EXTENSIONS to OFF and transitively disable extensions for inherited targets. + # * Defining __float128 on the command line is the least invasive workaround found here: https://bugs.llvm.org/show_bug.cgi?id=13530#c6 + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "__float128=void") + + # CMake 3.15 does not provide the `--std=c++11` argument to clang anymore. + # It is not necessary for basic c++ compilation because clangs default is already higher, but CUDA code compiled with -x cuda still defaults to c++98. + IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.15.0") + LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-std=c++${ALPAKA_CXX_STANDARD}") + ENDIF() + + ELSE() + IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + IF(CUDA_VERSION VERSION_EQUAL 8.0) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 5.4) + MESSAGE(FATAL_ERROR "NVCC 8.0 does not support GCC 5.4+. Please use GCC 4.9 - 5.3!") + ENDIF() + ELSEIF((CUDA_VERSION VERSION_EQUAL 9.0) OR (CUDA_VERSION VERSION_EQUAL 9.1)) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 6.0) + MESSAGE(FATAL_ERROR "NVCC 9.0 - 9.1 do not support GCC 7+ and fail compiling the std::tuple implementation in GCC 6+. Please use GCC 4.9 - 5.5!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 9.2) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 8.0) + MESSAGE(FATAL_ERROR "NVCC 9.2 does not support GCC 8+. Please use GCC 4.9, 5, 6 or 7!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 10.0) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 8.0) + MESSAGE(FATAL_ERROR "NVCC 10.0 does not support GCC 8+. Please use GCC 4.9, 5, 6 or 7!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 10.1) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 9.0) + MESSAGE(FATAL_ERROR "NVCC 10.1 does not support GCC 9+. Please use GCC 4.9, 5, 6, 7 or 8!") + ENDIF() + ENDIF() + ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + IF(CUDA_VERSION VERSION_EQUAL 8.0) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 4.0) + MESSAGE(FATAL_ERROR "NVCC 8.0 does not support clang 4+. Please use NVCC 9.1!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 9.0) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 4.0) + MESSAGE(FATAL_ERROR "NVCC 9.0 does not support clang 4+. Please use NVCC 9.1!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 9.1) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 5.0) + MESSAGE(FATAL_ERROR "NVCC 9.1 does not support clang 5+. Please use clang 4!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 9.2) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 5.0) + MESSAGE(FATAL_ERROR "NVCC 9.2 does not support clang 6+ and fails compiling with clang 5. Please use clang 4!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 10.0) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 7.0) + MESSAGE(FATAL_ERROR "NVCC 10.0 does not support clang 7+. Please use clang 4, 5 or 6!") + ENDIF() + ELSEIF(CUDA_VERSION VERSION_EQUAL 10.1) + IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 9.0) + MESSAGE(FATAL_ERROR "NVCC 10.1 does not support clang 9+. Please use clang 4, 5, 6, 7 or 8!") + ENDIF() + ENDIF() + ENDIF() + + # CUDA 9.0 removed the __CUDACC_VER__ macro. Boost versions lower than 1.65.1 still use this macro. + IF(CUDA_VERSION VERSION_GREATER_EQUAL 9.0 AND Boost_VERSION VERSION_LESS 1.65.1) + MESSAGE(WARNING "CUDA 9.0 or newer requires boost-1.65.1 or newer!") + SET(_ALPAKA_FOUND FALSE) + ENDIF() + + # CUDA 9.0 is the first to support c++14. + IF((CUDA_VERSION VERSION_LESS 9.0) AND (ALPAKA_CXX_STANDARD GREATER 11)) + MESSAGE(WARNING "CUDA 9.0 or newer is required for c++14 or higher!") + SET(_ALPAKA_FOUND FALSE) + ENDIF() + + IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE) + MESSAGE(FATAL_ERROR "NVCC does not support boost.fiber!") + ENDIF() + + # Clean up the flags. Else, multiple find calls would result in duplicate flags. Furthermore, other modules may have set different settings. + SET(CUDA_NVCC_FLAGS) + + IF(${ALPAKA_DEBUG} GREATER 1) + SET(CUDA_VERBOSE_BUILD ON) + ENDIF() + + SET(CUDA_PROPAGATE_HOST_FLAGS ON) + + IF(ALPAKA_CUDA_NVCC_SEPARABLE_COMPILATION) + SET(CUDA_SEPARABLE_COMPILATION ON) + ENDIF() + + # nvcc sets no linux/__linux macros on OpenPOWER linux + # nvidia bug id: 2448610 + IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le") + LIST(APPEND CUDA_NVCC_FLAGS "-Dlinux") + ENDIF() + ENDIF() + + IF(CUDA_VERSION VERSION_EQUAL 8.0) + LIST(APPEND CUDA_NVCC_FLAGS "-Wno-deprecated-gpu-targets") + ENDIF() + + + IF(ALPAKA_CUDA_NVCC_EXPT_EXTENDED_LAMBDA) + LIST(APPEND CUDA_NVCC_FLAGS "--expt-extended-lambda") + ENDIF() + IF(ALPAKA_CUDA_NVCC_EXPT_RELAXED_CONSTEXPR) + LIST(APPEND CUDA_NVCC_FLAGS "--expt-relaxed-constexpr") + ENDIF() + + FOREACH(_CUDA_ARCH_ELEM ${ALPAKA_CUDA_ARCH}) + # set flags to create device code for the given architecture + LIST(APPEND CUDA_NVCC_FLAGS + --generate-code arch=compute_${_CUDA_ARCH_ELEM},code=sm_${_CUDA_ARCH_ELEM} + --generate-code arch=compute_${_CUDA_ARCH_ELEM},code=compute_${_CUDA_ARCH_ELEM} + ) + ENDFOREACH() + + IF(NOT MSVC) + LIST(APPEND CUDA_NVCC_FLAGS "-std=c++${ALPAKA_CXX_STANDARD}") + ENDIF() + + SET(CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}") + + IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + LIST(APPEND CUDA_NVCC_FLAGS "-g") + # https://github.com/ComputationalRadiationPhysics/alpaka/issues/428 + IF(((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) OR + (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.8)) AND + CUDA_VERSION VERSION_LESS 9.0) + MESSAGE(WARNING "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} does not support -G with CUDA <= 8! " + "Device debug symbols NOT added.") + ELSEIF(MSVC) + MESSAGE(WARNING "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} does not support -G with CUDA! " + "Device debug symbols NOT added.") + ELSE() + LIST(APPEND CUDA_NVCC_FLAGS "-G") + ENDIF() + ENDIF() + + IF(ALPAKA_CUDA_FAST_MATH) + LIST(APPEND CUDA_NVCC_FLAGS "--use_fast_math") + ENDIF() + + IF(ALPAKA_CUDA_FTZ) + LIST(APPEND CUDA_NVCC_FLAGS "--ftz=true") + ELSE() + LIST(APPEND CUDA_NVCC_FLAGS "--ftz=false") + ENDIF() + + IF(ALPAKA_CUDA_SHOW_REGISTER) + LIST(APPEND CUDA_NVCC_FLAGS "-Xptxas=-v") + ENDIF() + # avoids warnings on host-device signatured, default constructors/destructors + IF(CUDA_VERSION GREATER_EQUAL 9.0) + LIST(APPEND CUDA_NVCC_FLAGS -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored) + ENDIF() + + IF(ALPAKA_CUDA_KEEP_FILES) + MAKE_DIRECTORY("${PROJECT_BINARY_DIR}/nvcc_tmp") + LIST(APPEND CUDA_NVCC_FLAGS "--keep" "--keep-dir" "${PROJECT_BINARY_DIR}/nvcc_tmp") + ENDIF() + + OPTION(ALPAKA_CUDA_SHOW_CODELINES "Show kernel lines in cuda-gdb and cuda-memcheck" OFF) + IF(ALPAKA_CUDA_SHOW_CODELINES) + LIST(APPEND CUDA_NVCC_FLAGS "--source-in-ptx" "-lineinfo") + IF(NOT MSVC) + LIST(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-rdynamic") + ENDIF() + SET(ALPAKA_CUDA_KEEP_FILES ON CACHE BOOL "activate keep files" FORCE) + ENDIF() + ENDIF() + + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC "general;${CUDA_CUDART_LIBRARY}") + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC ${CUDA_INCLUDE_DIRS}) + ENDIF() + ENDIF() +ENDIF() + +#------------------------------------------------------------------------------- +# Find HIP. +IF(ALPAKA_ACC_GPU_HIP_ENABLE) + + IF(NOT DEFINED ALPAKA_HIP_VERSION) + SET(ALPAKA_HIP_VERSION 1.5) + ENDIF() + + IF(ALPAKA_HIP_VERSION VERSION_LESS 1.5) + MESSAGE(WARNING "HIP < 1.5 is not supported!") + SET(_ALPAKA_FOUND FALSE) + + ELSE() + # must set this for HIP package (note that you also need certain env vars) + SET(HIP_PLATFORM "${ALPAKA_HIP_PLATFORM}" CACHE STRING "") + SET(HIP_RUNTIME "${ALPAKA_HIP_PLATFORM}" CACHE STRING "") + + FIND_PACKAGE(HIP "${ALPAKA_HIP_VERSION}") + IF(NOT HIP_FOUND) + MESSAGE(WARNING "Optional alpaka dependency HIP could not be found! HIP back-end disabled!") + SET(ALPAKA_ACC_GPU_HIP_ENABLE OFF CACHE BOOL "Enable the HIP GPU back-end" FORCE) + + ELSE() + SET(ALPAKA_HIP_VERSION "${HIP_VERSION}") + IF(ALPAKA_HIP_VERSION VERSION_LESS 1.5.19211) + MESSAGE(STATUS "HIP < 1.5.19211 untested!") + ENDIF() + SET(ALPAKA_HIP_COMPILER "hipcc" CACHE STRING "HIP compiler") + SET_PROPERTY(CACHE ALPAKA_HIP_COMPILER PROPERTY STRINGS "hipcc") + + OPTION(ALPAKA_HIP_FAST_MATH "Enable fast-math" ON) + OPTION(ALPAKA_HIP_FTZ "Set flush to zero for GPU" OFF) + OPTION(ALPAKA_HIP_SHOW_REGISTER "Show kernel registers and create PTX" OFF) + OPTION(ALPAKA_HIP_KEEP_FILES "Keep all intermediate files that are generated during internal compilation steps (folder: nvcc_tmp)" OFF) + + SET(HIP_HIPCC_FLAGS) + + IF(ALPAKA_HIP_PLATFORM MATCHES "nvcc") + FIND_PACKAGE(CUDA) + IF(NOT CUDA_FOUND) + MESSAGE(WARNING "Could not found CUDA while HIP platform is set to nvcc. Compiling might fail.") + ENDIF() + + IF(CUDA_VERSION VERSION_LESS 9.0) + SET(ALPAKA_CUDA_ARCH "20" CACHE STRING "GPU architecture") + ELSE() + SET(ALPAKA_CUDA_ARCH "30" CACHE STRING "GPU architecture") + ENDIF() + + # CUDA 9.0 removed the __CUDACC_VER__ macro. Boost versions lower than 1.65.1 still use this macro. + IF(CUDA_VERSION VERSION_GREATER_EQUAL 9.0 AND Boost_VERSION VERSION_LESS 1.65.1) + MESSAGE(WARNING "CUDA 9.0 or newer requires boost-1.65.1 or newer!") + SET(_ALPAKA_FOUND FALSE) + ENDIF() + + IF(CUDA_VERSION VERSION_EQUAL 8.0) + LIST(APPEND HIP_HIPCC_FLAGS "-Wno-deprecated-gpu-targets") + ENDIF() + + IF(CUDA_VERSION VERSION_LESS 8.0) + MESSAGE(WARNING "CUDA Toolkit < 8.0 is not supported!") + SET(_ALPAKA_FOUND FALSE) + ENDIF() + + IF(${ALPAKA_DEBUG} GREATER 1) + SET(HIP_VERBOSE_BUILD ON) + ENDIF() + + LIST(APPEND HIP_NVCC_FLAGS "--expt-extended-lambda") + LIST(APPEND HIP_NVCC_FLAGS "--expt-relaxed-constexpr") + LIST(APPEND _ALPAKA_HIP_LIBRARIES "cudart") + + FOREACH(_HIP_ARCH_ELEM ${ALPAKA_CUDA_ARCH}) + # set flags to create device code for the given architecture + LIST(APPEND CUDA_NVCC_FLAGS + --generate-code arch=compute_${_HIP_ARCH_ELEM},code=sm_${_HIP_ARCH_ELEM} + --generate-code arch=compute_${_HIP_ARCH_ELEM},code=compute_${_HIP_ARCH_ELEM} + ) + ENDFOREACH() + # for CUDA cmake adds automatically compiler flags as nvcc does not do this, + # but for HIP we have to do this here + LIST(APPEND HIP_NVCC_FLAGS "-D__CUDACC__") + LIST(APPEND HIP_NVCC_FLAGS "-ccbin ${CMAKE_CXX_COMPILER}") + LIST(APPEND HIP_NVCC_FLAGS "-Xcompiler" "-g") + + IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + LIST(APPEND HIP_HIPCC_FLAGS "-G") + ENDIF() + # propage host flags + # SET(CUDA_PROPAGATE_HOST_FLAGS ON) # does not exist in HIP, so do it manually + string(TOUPPER "${CMAKE_BUILD_TYPE}" build_config) + FOREACH( _flag ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${build_config}}) + LIST(APPEND HIP_NVCC_FLAGS "-Xcompiler ${_flag}") + ENDFOREACH() + + IF(ALPAKA_HIP_FAST_MATH) + LIST(APPEND HIP_HIPCC_FLAGS "--use_fast_math") + ENDIF() + + IF(ALPAKA_HIP_FTZ) + LIST(APPEND HIP_HIPCC_FLAGS "--ftz=true") + ELSE() + LIST(APPEND HIP_HIPCC_FLAGS "--ftz=false") + ENDIF() + + IF(ALPAKA_HIP_SHOW_REGISTER) + LIST(APPEND HIP_HIPCC_FLAGS "-Xptxas=-v") + ENDIF() + IF(CUDA_VERSION GREATER_EQUAL 9.0) + # avoids warnings on host-device signatured, default constructors/destructors + LIST(APPEND HIP_HIPCC_FLAGS "-Xcudafe --diag_suppress=esa_on_defaulted_function_ignored") + ENDIF() + + # random numbers library ( HIP(NVCC) ) /hiprand + # HIP_ROOT_DIR is set by FindHIP.cmake + FIND_PATH(HIP_RAND_INC + NAMES "hiprand_kernel.h" + PATHS "${HIP_ROOT_DIR}/hiprand" "${HIP_ROOT_DIR}/include" "hiprand" + PATHS "/opt/rocm/rocrand/hiprand" + PATH_SUFFIXES "include" "hiprand") + FIND_LIBRARY(HIP_RAND_LIBRARY + NAMES "hiprand-d" "hiprand" + PATHS "${HIP_ROOT_DIR}/hiprand" "${HIP_ROOT_DIR}" "hiprand" + PATHS "/opt/rocm/rocrand/hiprand" + ENV HIP_PATH + PATH_SUFFIXES "lib" "lib64") + IF(NOT HIP_RAND_INC) + MESSAGE(FATAL_ERROR "Could not find hipRAND include (also searched in: HIP_ROOT_DIR=${HIP_ROOT_DIR}).") + ENDIF() + IF(NOT HIP_RAND_LIBRARY) + MESSAGE(FATAL_ERROR "Could not find hipRAND library (also searched in: HIP_ROOT_DIR=${HIP_ROOT_DIR}).") + ENDIF() + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC "${HIP_RAND_INC}") + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC "${HIP_RAND_LIBRARY}") + ENDIF() # nvcc + + IF(ALPAKA_HIP_PLATFORM MATCHES "hcc") + + # random numbers library ( HIP(HCC) ) /rocrand + FIND_PATH(ROC_RAND_INC + rocrand_kernel.h + PATHS "${HIP_ROOT_DIR}/rocrand" "${HIP_ROOT_DIR}" "rocrand" + PATHS "/opt/rocm/rocrand" + ENV HIP_PATH + PATH_SUFFIXES "include") + FIND_LIBRARY(ROC_RAND_LIBRARY + rocrand-d + rocrand + PATHS "${HIP_ROOT_DIR}/rocrand" "${HIP_ROOT_DIR}" "rocrand" + PATHS "/opt/rocm/rocrand" + ENV HIP_PATH + PATH_SUFFIXES "lib" "lib64") + + # random numbers library ( HIP(HCC) ) rocrand/hiprand + FIND_PATH(HIP_RAND_INC + hiprand_kernel.h + PATHS "${HIP_ROOT_DIR}/hiprand" "${HIP_ROOT_DIR}" "hiprand" + PATHS "/opt/rocm/hiprand" + ENV HIP_PATH + PATH_SUFFIXES "include") + FIND_LIBRARY(HIP_RAND_LIBRARY + hiprand-d + hiprand + PATHS "${HIP_ROOT_DIR}/hiprand" "${HIP_ROOT_DIR}" "hiprand" + PATHS "/opt/rocm/hiprand" + ENV HIP_PATH + PATH_SUFFIXES "lib" "lib64") + IF(NOT HIP_RAND_INC OR NOT HIP_RAND_LIBRARY) + MESSAGE(FATAL_ERROR "Could not find hipRAND library") + ENDIF() + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC "${HIP_RAND_INC}") + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC "${HIP_RAND_LIBRARY}") + + IF(NOT ROC_RAND_INC OR NOT ROC_RAND_LIBRARY) + MESSAGE(FATAL_ERROR "Could not find rocRAND library") + ENDIF() + + LIST(APPEND _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC "${ROC_RAND_INC}") + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC "${ROC_RAND_LIBRARY}") + + ENDIF() + + + LIST(APPEND HIP_HIPCC_FLAGS "-D__HIPCC__") + LIST(APPEND HIP_HIPCC_FLAGS "-std=c++${ALPAKA_CXX_STANDARD}") + + IF(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + LIST(APPEND HIP_HIPCC_FLAGS "-g") + ENDIF() + + + IF(ALPAKA_HIP_KEEP_FILES) + MAKE_DIRECTORY("${PROJECT_BINARY_DIR}/hip_tmp") + LIST(APPEND HIP_HIPCC_FLAGS "--keep" "--keep-dir" "${PROJECT_BINARY_DIR}/hip_tmp") + ENDIF() + + OPTION(ALPAKA_HIP_SHOW_CODELINES "Show kernel lines in cuda-gdb and cuda-memcheck" OFF) + IF(ALPAKA_HIP_SHOW_CODELINES) + LIST(APPEND HIP_HIPCC_FLAGS "--source-in-ptx" "-lineinfo") + LIST(APPEND HIP_HIPCC_FLAGS "-Xcompiler" "-rdynamic") + SET(ALPAKA_HIP_KEEP_FILES ON CACHE BOOL "activate keep files" FORCE) + ENDIF() + IF(_ALPAKA_HIP_LIBRARIES) + LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC "general;${_ALPAKA_HIP_LIBRARIES}") + ENDIF() + ENDIF() + ENDIF() +ENDIF() # HIP + +#------------------------------------------------------------------------------- +# alpaka. +IF(ALPAKA_ACC_GPU_CUDA_ONLY_MODE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_GPU_CUDA_ONLY_MODE") + MESSAGE(STATUS ALPAKA_ACC_GPU_CUDA_ONLY_MODE) +ENDIF() + +IF(ALPAKA_ACC_GPU_HIP_ONLY_MODE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_GPU_HIP_ONLY_MODE") + MESSAGE(STATUS ALPAKA_ACC_GPU_HIP_ONLY_MODE) +ENDIF() + +IF(ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED) +ENDIF() +IF(ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_CPU_B_SEQ_T_THREADS_ENABLED) +ENDIF() +IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLED) +ENDIF() +IF(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLED) +ENDIF() +IF(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLED) +ENDIF() +IF(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLED) +ENDIF() +IF(ALPAKA_ACC_CPU_BT_OMP4_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_CPU_BT_OMP4_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_CPU_BT_OMP4_ENABLED) +ENDIF() +IF(ALPAKA_ACC_GPU_CUDA_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_GPU_CUDA_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_GPU_CUDA_ENABLED) +ENDIF() +IF(ALPAKA_ACC_GPU_HIP_ENABLE) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_ACC_GPU_HIP_ENABLED") + MESSAGE(STATUS ALPAKA_ACC_GPU_HIP_ENABLED) +ENDIF() + +LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_DEBUG=${ALPAKA_DEBUG}") + +IF(ALPAKA_CI) + LIST(APPEND _ALPAKA_COMPILE_DEFINITIONS_PUBLIC "ALPAKA_CI") +ENDIF() + +SET(_ALPAKA_INCLUDE_DIRECTORY "${_ALPAKA_ROOT_DIR}/include") +SET(_ALPAKA_SUFFIXED_INCLUDE_DIR "${_ALPAKA_INCLUDE_DIRECTORY}/alpaka") + +SET(_ALPAKA_LINK_LIBRARY) + +# # cxx flags will not be forwarded to hip wrapped compiler, so it has to be provided manually +IF(ALPAKA_ACC_GPU_HIP_ENABLE) + SET(_ALPAKA_COMPILE_DEFINITIONS_HIP ${_ALPAKA_COMPILE_DEFINITIONS_PUBLIC}) + LIST_ADD_PREFIX("-D" _ALPAKA_COMPILE_DEFINITIONS_HIP) + LIST(APPEND HIP_HIPCC_FLAGS + ${_ALPAKA_COMPILE_DEFINITIONS_HIP} + ) + HIP_INCLUDE_DIRECTORIES( + # ${_ALPAKA_INCLUDE_DIRECTORY} + # ${_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC} + ${HIP_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${_ALPAKA_ROOT_DIR}/test/common/include + ) + + IF(OPENMP_FOUND) # remove fopenmp link from nvcc, otherwise linker error will occur + LIST(REMOVE_ITEM _ALPAKA_LINK_FLAGS_PUBLIC "${OpenMP_CXX_FLAGS}") + LIST(APPEND _ALPAKA_LINK_FLAGS_PUBLIC "-Xcompiler ${OpenMP_CXX_FLAGS}") + ENDIF() + IF(ALPAKA_HIP_PLATFORM MATCHES "hcc") + # GFX600, GFX601, GFX700, GFX701, GFX702, GFX703, GFX704, GFX801, GFX802, GFX803, GFX810, GFX900, GFX902 + SET(_ALPAKA_LINK_LIBRARIES_PUBLIC "${_ALPAKA_LINK_LIBRARIES_PUBLIC}" "--amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906") + ENDIF() +ENDIF() + +# Add all the source and include files in all recursive subdirectories and group them accordingly. +append_recursive_files_add_to_src_group("${_ALPAKA_SUFFIXED_INCLUDE_DIR}" "${_ALPAKA_SUFFIXED_INCLUDE_DIR}" "hpp" _ALPAKA_FILES_HEADER) +append_recursive_files_add_to_src_group("${_ALPAKA_SUFFIXED_INCLUDE_DIR}" "${_ALPAKA_SUFFIXED_INCLUDE_DIR}" "h" _ALPAKA_FILES_HEADER) + +append_recursive_files_add_to_src_group("${_ALPAKA_ROOT_DIR}/script" "${_ALPAKA_ROOT_DIR}" "sh" _ALPAKA_FILES_SCRIPT) +SET_SOURCE_FILES_PROPERTIES(${_ALPAKA_FILES_SCRIPT} PROPERTIES HEADER_FILE_ONLY TRUE) + +append_recursive_files_add_to_src_group("${_ALPAKA_ROOT_DIR}/cmake" "${_ALPAKA_ROOT_DIR}" "cmake" _ALPAKA_FILES_CMAKE) +LIST(APPEND _ALPAKA_FILES_CMAKE "${_ALPAKA_ROOT_DIR}/alpakaConfig.cmake" "${_ALPAKA_ROOT_DIR}/Findalpaka.cmake" "${_ALPAKA_ROOT_DIR}/CMakeLists.txt" "${_ALPAKA_ROOT_DIR}/cmake/dev.cmake" "${_ALPAKA_ROOT_DIR}/cmake/common.cmake" "${_ALPAKA_ROOT_DIR}/cmake/addExecutable.cmake" "${_ALPAKA_ADD_LIBRRAY_FILE}") +SET_SOURCE_FILES_PROPERTIES(${_ALPAKA_FILES_CMAKE} PROPERTIES HEADER_FILE_ONLY TRUE) + +append_recursive_files_add_to_src_group("${_ALPAKA_ROOT_DIR}/doc/markdown" "${_ALPAKA_ROOT_DIR}" "md" _ALPAKA_FILES_DOC) +SET_SOURCE_FILES_PROPERTIES(${_ALPAKA_FILES_DOC} PROPERTIES HEADER_FILE_ONLY TRUE) + +SET(_ALPAKA_FILES_OTHER "${_ALPAKA_ROOT_DIR}/.gitignore" "${_ALPAKA_ROOT_DIR}/.travis.yml" "${_ALPAKA_ROOT_DIR}/.zenodo.json" "${_ALPAKA_ROOT_DIR}/LICENSE" "${_ALPAKA_ROOT_DIR}/README.md") +SET_SOURCE_FILES_PROPERTIES(${_ALPAKA_FILES_OTHER} PROPERTIES HEADER_FILE_ONLY TRUE) + +#------------------------------------------------------------------------------- +# Target. +IF(NOT TARGET "alpaka") + ADD_LIBRARY("alpaka" INTERFACE) + + # HACK: Workaround for the limitation that files added to INTERFACE targets (target_sources) can not be marked as PUBLIC or PRIVATE but only as INTERFACE. + # Therefore those files will be added to projects "linking" to the INTERFACE library, but are not added to the project itself within an IDE. + add_custom_target("alpakaIde" + SOURCES ${_ALPAKA_FILES_HEADER} ${_ALPAKA_FILES_SCRIPT} ${_ALPAKA_FILES_CMAKE} ${_ALPAKA_FILES_DOC} ${_ALPAKA_FILES_OTHER} + ) + + target_compile_features("alpaka" + INTERFACE cxx_std_${ALPAKA_CXX_STANDARD} + ) + + # Compile options. + IF(${ALPAKA_DEBUG} GREATER 1) + MESSAGE(STATUS "_ALPAKA_COMPILE_OPTIONS_PUBLIC: ${_ALPAKA_COMPILE_OPTIONS_PUBLIC}") + ENDIF() + LIST( + LENGTH + _ALPAKA_COMPILE_OPTIONS_PUBLIC + _ALPAKA_COMPILE_OPTIONS_PUBLIC_LENGTH) + IF(${_ALPAKA_COMPILE_OPTIONS_PUBLIC_LENGTH} GREATER 0) + TARGET_COMPILE_OPTIONS( + "alpaka" + INTERFACE ${_ALPAKA_COMPILE_OPTIONS_PUBLIC}) + ENDIF() + + # Compile definitions. + IF(${ALPAKA_DEBUG} GREATER 1) + MESSAGE(STATUS "_ALPAKA_COMPILE_DEFINITIONS_PUBLIC: ${_ALPAKA_COMPILE_DEFINITIONS_PUBLIC}") + ENDIF() + LIST( + LENGTH + _ALPAKA_COMPILE_DEFINITIONS_PUBLIC + _ALPAKA_COMPILE_DEFINITIONS_PUBLIC_LENGTH) + IF(${_ALPAKA_COMPILE_DEFINITIONS_PUBLIC_LENGTH} GREATER 0) + TARGET_COMPILE_DEFINITIONS( + "alpaka" + INTERFACE ${_ALPAKA_COMPILE_DEFINITIONS_PUBLIC}) + ENDIF() + + # Include directories. + IF(${ALPAKA_DEBUG} GREATER 1) + MESSAGE(STATUS "_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC: ${_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC}") + ENDIF() + LIST( + LENGTH + _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC + _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC_LENGTH) + IF(${_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC_LENGTH} GREATER 0) + TARGET_INCLUDE_DIRECTORIES( + "alpaka" + SYSTEM + INTERFACE ${_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC}) + ENDIF() + # the alpaka library itself + TARGET_INCLUDE_DIRECTORIES( + "alpaka" + INTERFACE ${_ALPAKA_INCLUDE_DIRECTORY} + ) + + # Link libraries. + # There are no PUBLIC_LINK_FLAGS in CMAKE: + # http://stackoverflow.com/questions/26850889/cmake-keeping-link-flags-of-internal-libs + IF(${ALPAKA_DEBUG} GREATER 1) + MESSAGE(STATUS "_ALPAKA_LINK_LIBRARIES_PUBLIC: ${_ALPAKA_LINK_LIBRARIES_PUBLIC}") + ENDIF() + LIST( + LENGTH + _ALPAKA_LINK_LIBRARIES_PUBLIC + _ALPAKA_LINK_LIBRARIES_PUBLIC_LENGTH) + IF(${_ALPAKA_LINK_LIBRARIES_PUBLIC_LENGTH} GREATER 0) + TARGET_LINK_LIBRARIES( + "alpaka" + INTERFACE ${_ALPAKA_LINK_LIBRARIES_PUBLIC} ${_ALPAKA_LINK_FLAGS_PUBLIC}) + ENDIF() +ENDIF() + +# NVCC does not incorporate the COMPILE_OPTIONS of a target but only the CMAKE_CXX_FLAGS +IF((ALPAKA_ACC_GPU_CUDA_ENABLE OR ALPAKA_ACC_GPU_HIP_ENABLE) AND ALPAKA_CUDA_COMPILER MATCHES "nvcc") + STRING(REPLACE ";" " " _ALPAKA_COMPILE_OPTIONS_STRING "${_ALPAKA_COMPILE_OPTIONS_PUBLIC}") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_ALPAKA_COMPILE_OPTIONS_STRING}") +ENDIF() + +#------------------------------------------------------------------------------- +# Find alpaka version. +file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/include/alpaka/version.hpp" ALPAKA_VERSION_MAJOR_HPP REGEX "#define ALPAKA_VERSION_MAJOR ") +file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/include/alpaka/version.hpp" ALPAKA_VERSION_MINOR_HPP REGEX "#define ALPAKA_VERSION_MINOR ") +file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/include/alpaka/version.hpp" ALPAKA_VERSION_PATCH_HPP REGEX "#define ALPAKA_VERSION_PATCH ") + +string(REGEX MATCH "([0-9]+)" ALPAKA_VERSION_MAJOR ${ALPAKA_VERSION_MAJOR_HPP}) +string(REGEX MATCH "([0-9]+)" ALPAKA_VERSION_MINOR ${ALPAKA_VERSION_MINOR_HPP}) +string(REGEX MATCH "([0-9]+)" ALPAKA_VERSION_PATCH ${ALPAKA_VERSION_PATCH_HPP}) + +SET(PACKAGE_VERSION "${ALPAKA_VERSION_MAJOR}.${ALPAKA_VERSION_MINOR}.${ALPAKA_VERSION_PATCH}") + +#------------------------------------------------------------------------------- +# Set return values. +SET(alpaka_VERSION "${ALPAKA_VERSION_MAJOR}.${ALPAKA_VERSION_MINOR}.${ALPAKA_VERSION_PATCH}") +SET(alpaka_COMPILE_OPTIONS ${_ALPAKA_COMPILE_OPTIONS_PUBLIC}) +SET(alpaka_COMPILE_DEFINITIONS ${_ALPAKA_COMPILE_DEFINITIONS_PUBLIC}) +# Add '-D' to the definitions +SET(alpaka_DEFINITIONS ${_ALPAKA_COMPILE_DEFINITIONS_PUBLIC}) +list_add_prefix("-D" alpaka_DEFINITIONS) +# Add the compile options to the definitions. +LIST(APPEND alpaka_DEFINITIONS ${_ALPAKA_COMPILE_OPTIONS_PUBLIC}) +SET(alpaka_INCLUDE_DIR ${_ALPAKA_INCLUDE_DIRECTORY}) +SET(alpaka_INCLUDE_DIRS ${_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC}) +LIST(APPEND alpaka_INCLUDE_DIRS ${_ALPAKA_INCLUDE_DIRECTORY}) +SET(alpaka_LIBRARY ${_ALPAKA_LINK_LIBRARY}) +SET(alpaka_LIBRARIES ${_ALPAKA_LINK_FLAGS_PUBLIC}) +LIST(APPEND alpaka_LIBRARIES ${_ALPAKA_LINK_LIBRARIES_PUBLIC}) + +#------------------------------------------------------------------------------- +# Print the return values. +IF(${ALPAKA_DEBUG} GREATER 0) + MESSAGE(STATUS "alpaka_FOUND: ${alpaka_FOUND}") + MESSAGE(STATUS "alpaka_VERSION: ${alpaka_VERSION}") + MESSAGE(STATUS "alpaka_COMPILE_OPTIONS: ${alpaka_COMPILE_OPTIONS}") + MESSAGE(STATUS "alpaka_COMPILE_DEFINITIONS: ${alpaka_COMPILE_DEFINITIONS}") + MESSAGE(STATUS "alpaka_DEFINITIONS: ${alpaka_DEFINITIONS}") + MESSAGE(STATUS "alpaka_INCLUDE_DIR: ${alpaka_INCLUDE_DIR}") + MESSAGE(STATUS "alpaka_INCLUDE_DIRS: ${alpaka_INCLUDE_DIRS}") + MESSAGE(STATUS "alpaka_LIBRARY: ${alpaka_LIBRARY}") + MESSAGE(STATUS "alpaka_LIBRARIES: ${alpaka_LIBRARIES}") +ENDIF() + +# Unset already set variables if not found. +IF(NOT _ALPAKA_FOUND) + UNSET(alpaka_FOUND) + UNSET(alpaka_VERSION) + UNSET(alpaka_COMPILE_OPTIONS) + UNSET(alpaka_COMPILE_DEFINITIONS) + UNSET(alpaka_DEFINITIONS) + UNSET(alpaka_INCLUDE_DIR) + UNSET(alpaka_INCLUDE_DIRS) + UNSET(alpaka_LIBRARY) + UNSET(alpaka_LIBRARIES) + + UNSET(_ALPAKA_FOUND) + UNSET(_ALPAKA_COMPILE_OPTIONS_PUBLIC) + UNSET(_ALPAKA_COMPILE_DEFINITIONS_PUBLIC) + UNSET(_ALPAKA_COMPILE_DEFINITIONS_HIP) + UNSET(_ALPAKA_HIP_LIBRARIES) + UNSET(_ALPAKA_INCLUDE_DIRECTORY) + UNSET(_ALPAKA_INCLUDE_DIRECTORIES_PUBLIC) + UNSET(_ALPAKA_LINK_LIBRARY) + UNSET(_ALPAKA_LINK_LIBRARIES_PUBLIC) + UNSET(_ALPAKA_LINK_FLAGS_PUBLIC) + UNSET(_ALPAKA_COMMON_FILE) + UNSET(_ALPAKA_ADD_EXECUTABLE_FILE) + UNSET(_ALPAKA_ADD_LIBRARY_FILE) + UNSET(_ALPAKA_FILES_HEADER) + UNSET(_ALPAKA_FILES_OTHER) + UNSET(_ALPAKA_BOOST_MIN_VER) +ELSE() + # Make internal variables advanced options in the GUI. + MARK_AS_ADVANCED( + alpaka_INCLUDE_DIR + alpaka_LIBRARY + _ALPAKA_COMPILE_OPTIONS_PUBLIC + _ALPAKA_COMPILE_DEFINITIONS_PUBLIC + _ALPAKA_INCLUDE_DIRECTORY + _ALPAKA_INCLUDE_DIRECTORIES_PUBLIC + _ALPAKA_LINK_LIBRARY + _ALPAKA_LINK_LIBRARIES_PUBLIC + _ALPAKA_LINK_FLAGS_PUBLIC + _ALPAKA_COMMON_FILE + _ALPAKA_ADD_EXECUTABLE_FILE + _ALPAKA_ADD_LIBRARY_FILE + _ALPAKA_FILES_HEADER + _ALPAKA_FILES_OTHER + _ALPAKA_BOOST_MIN_VER) +ENDIF() + +############################################################################### +# FindPackage options + +# Handles the REQUIRED, QUIET and version-related arguments for FIND_PACKAGE. +# NOTE: We do not check for alpaka_LIBRARIES and alpaka_DEFINITIONS because they can be empty. +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( + "alpaka" + FOUND_VAR alpaka_FOUND + REQUIRED_VARS alpaka_INCLUDE_DIR + VERSION_VAR alpaka_VERSION) diff --git a/alpaka/cmake/addExecutable.cmake b/alpaka/cmake/addExecutable.cmake new file mode 100644 index 0000000000..b602374544 --- /dev/null +++ b/alpaka/cmake/addExecutable.cmake @@ -0,0 +1,64 @@ +# +# Copyright 2014-2019 Benjamin Worpitz +# +# This file is part of Alpaka. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 3.11.4) + +#------------------------------------------------------------------------------ +# Calls CUDA_ADD_EXECUTABLE or ADD_EXECUTABLE depending on the enabled alpaka accelerators. +# Using a macro to stay in the scope (fixes lost assignment of linker command in FindHIP.cmake) +# https://github.com/ROCm-Developer-Tools/HIP/issues/631 +MACRO(ALPAKA_ADD_EXECUTABLE In_Name) + IF(ALPAKA_ACC_GPU_CUDA_ENABLE) + IF(ALPAKA_CUDA_COMPILER MATCHES "clang") + FOREACH(_file ${ARGN}) + IF((${_file} MATCHES "\\.cpp$") OR (${_file} MATCHES "\\.cxx$") OR (${_file} MATCHES "\\.cu$")) + SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES COMPILE_FLAGS "-x cuda") + ENDIF() + ENDFOREACH() + ADD_EXECUTABLE( + ${In_Name} + ${ARGN}) + ELSE() + FOREACH(_file ${ARGN}) + IF((${_file} MATCHES "\\.cpp$") OR (${_file} MATCHES "\\.cxx$")) + SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) + ENDIF() + ENDFOREACH() + IF (CMAKE_VERSION VERSION_LESS 3.9.0) + CMAKE_POLICY(SET CMP0023 OLD) # CUDA_ADD_EXECUTABLE calls TARGET_LINK_LIBRARIES without keywords. + ELSE() + SET(CUDA_LINK_LIBRARIES_KEYWORD "PUBLIC") + ENDIF() + CUDA_ADD_EXECUTABLE( + ${In_Name} + ${ARGN}) + ENDIF() + ELSEIF(ALPAKA_ACC_GPU_HIP_ENABLE) + FOREACH(_file ${ARGN}) + IF((${_file} MATCHES "\\.cpp$") OR (${_file} MATCHES "\\.cxx$")) + SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT OBJ) + ENDIF() + ENDFOREACH() + IF (CMAKE_VERSION VERSION_LESS 3.9.0) + CMAKE_POLICY(SET CMP0023 OLD) # CUDA_ADD_EXECUTABLE calls TARGET_LINK_LIBRARIES without keywords. + ELSE() + SET(HIP_LINK_LIBRARIES_KEYWORD "PUBLIC") + ENDIF() + + HIP_ADD_EXECUTABLE( + ${In_Name} + ${ARGN}) + + ELSE() + ADD_EXECUTABLE( + ${In_Name} + ${ARGN}) + ENDIF() +ENDMACRO() diff --git a/alpaka/cmake/addLibrary.cmake b/alpaka/cmake/addLibrary.cmake new file mode 100644 index 0000000000..2d1c497341 --- /dev/null +++ b/alpaka/cmake/addLibrary.cmake @@ -0,0 +1,155 @@ +# +# Copyright 2015-2019 Benjamin Worpitz, Maximilian Knespel +# +# This file is part of Alpaka. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +CMAKE_MINIMUM_REQUIRED(VERSION 3.11.4) + +#------------------------------------------------------------------------------ +# Calls CUDA_ADD_LIBRARY or ADD_LIBRARY depending on the enabled alpaka +# accelerators. +# +# ALPAKA_ADD_LIBRARY( cuda_target file0 file1 ... [STATIC | SHARED | MODULE] +# [EXCLUDE_FROM_ALL] [OPTIONS ... ] ) +# +# In order to be compliant with both ADD_LIBRARY and CUDA_ADD_LIBRARY +# the position of STATIC, SHARED, MODULE, EXCLUDE_FROM_ALL options don't matter. +# This also means you won't be able to include files with those exact same +# case-sensitive names. +# After OPTIONS only nvcc compiler flags are allowed though. And for readiblity +# and portability you shouldn't completely mix STATIC, ... with the source +# code filenames! +# OPTIONS and the arguments thereafter are ignored if not using CUDA, they +# won't throw an error in that case. +MACRO(ALPAKA_ADD_LIBRARY libraryName) + # CUDA_ADD_LIBRARY( cuda_target file0 file1 ... + # [STATIC | SHARED | MODULE] + # [EXCLUDE_FROM_ALL] [OPTIONS ... ] ) + # add_library( [STATIC | SHARED | MODULE] + # [EXCLUDE_FROM_ALL] + # source1 [source2 ...] ) + + # traverse arguments and sort them by option and source files + SET( arguments ${ARGN} ) + SET( optionsEncountered OFF ) + UNSET( libraryType ) + UNSET( excludeFromAll ) + UNSET( optionArguments ) + FOREACH( argument IN LISTS arguments ) + # 1.) check for OPTIONS + IF( argument STREQUAL "OPTIONS" ) + IF ( optionsEncountered ) + MESSAGE( FATAL_ERROR "[ALPAKA_ADD_LIBRARY] OPTIONS subcommand specified more than one time. This is not allowed!" ) + ELSE() + SET( optionsEncountered ON ) + ENDIF() + ENDIF() + + # 2.) check if inside OPTIONS, because then all other checks are + # unnecessary although they could give hints about wrong locations + # of those subcommands + IF( optionsEncountered ) + LIST( APPEND optionArguments "${argument}" ) + CONTINUE() + ENDIF() + + # 3.) check for libraryType and EXCLUDE_FROM_ALL + IF( ( argument STREQUAL "STATIC" ) OR + ( argument STREQUAL "SHARED" ) OR + ( argument STREQUAL "MODULE" ) + ) + IF( DEFINED libraryType ) + message( FATAL_ERROR "Setting more than one library type option ( STATIC SHARED MODULE ) not allowed!" ) + ENDIF() + set( libraryType ${argument} ) + CONTINUE() + ENDIF() + IF( argument STREQUAL "EXCLUDE_FROM_ALL" ) + SET( excludeFromAll ${argument} ) + CONTINUE() + ENDIF() + + # 4.) ELSE the argument is a file name + list( APPEND sourceFileNames "${argument}" ) + ENDFOREACH() + UNSET( optionsEncountered ) + #message( "libraryType = ${libraryType}" ) + #message( "sourceFileNames = ${sourceFileNames}" ) + + # call add_library or cuda_add_library now + IF( ALPAKA_ACC_GPU_CUDA_ENABLE ) + IF(ALPAKA_CUDA_COMPILER MATCHES "clang") + FOREACH( _file ${ARGN} ) + IF( ( ${_file} MATCHES "\\.cpp$" ) OR + ( ${_file} MATCHES "\\.cxx$" ) OR + ( ${_file} MATCHES "\\.cu$" ) + ) + SET_SOURCE_FILES_PROPERTIES( ${_file} PROPERTIES COMPILE_FLAGS "-x cuda" ) + ENDIF() + ENDFOREACH() + ADD_LIBRARY( + ${libraryName} + ${sourceFileNames} + ${libraryType} + ${excludeFromAll} + ${optionArguments} + ) + ELSE() + FOREACH( _file ${ARGN} ) + IF( ( ${_file} MATCHES "\\.cpp$" ) OR + ( ${_file} MATCHES "\\.cxx$" ) + ) + SET_SOURCE_FILES_PROPERTIES( ${_file} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ ) + ENDIF() + ENDFOREACH() + IF (CMAKE_VERSION VERSION_LESS 3.9.0) + CMAKE_POLICY(SET CMP0023 OLD) # CUDA_ADD_EXECUTABLE calls TARGET_LINK_LIBRARIES without keywords. + ELSE() + SET(CUDA_LINK_LIBRARIES_KEYWORD "PUBLIC") + ENDIF() + CUDA_ADD_LIBRARY( + ${libraryName} + ${sourceFileNames} + ${libraryType} + ${excludeFromAll} + ${optionArguments} + ) + ENDIF() + ELSEIF( ALPAKA_ACC_GPU_HIP_ENABLE ) + FOREACH( _file ${ARGN} ) + IF( ( ${_file} MATCHES "\\.cpp$" ) OR + ( ${_file} MATCHES "\\.cxx$" ) + ) + SET_SOURCE_FILES_PROPERTIES( ${_file} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT OBJ ) + ENDIF() + ENDFOREACH() + CMAKE_POLICY(SET CMP0023 OLD) # CUDA_ADD_LIBRARY calls TARGET_LINK_LIBRARIES without keywords. + HIP_ADD_LIBRARY( + ${libraryName} + ${sourceFileNames} + ${libraryType} + ${excludeFromAll} + ${optionArguments} + ) + + ELSE() + #message( "add_library( ${libraryName} ${libraryType} ${excludeFromAll} ${sourceFileNames} )" ) + ADD_LIBRARY( + ${libraryName} + ${libraryType} + ${excludeFromAll} + ${sourceFileNames} + ) + ENDIF() + + # UNSET variables (not sure if necessary) + UNSET( libraryType ) + UNSET( sourceFileNames ) + UNSET( excludeFromAll ) + UNSET( optionArguments ) +ENDMACRO() diff --git a/alpaka/cmake/common.cmake b/alpaka/cmake/common.cmake new file mode 100644 index 0000000000..af212c1c2e --- /dev/null +++ b/alpaka/cmake/common.cmake @@ -0,0 +1,212 @@ +# +# Copyright 2014-2019 Benjamin Worpitz +# +# This file is part of Alpaka. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +#------------------------------------------------------------------------------ +# Gets all recursive files with the given ending in the given directory and recursively below. +# This makes adding files easier because we do not have to update a list each time a file is added but this prevents CMake from detecting if it should be rerun! +FUNCTION(append_recursive_files In_RootDir In_FileExtension Out_FilePathsListVariableName) + #MESSAGE("In_RootDir: ${In_RootDir}") + #MESSAGE("In_FileExtension: ${In_FileExtension}") + #MESSAGE("Out_FilePathsListVariableName: ${Out_FilePathsListVariableName}") + # Get all recursive files. + FILE( + GLOB_RECURSE + relativeFilePathsList + "${In_RootDir}/*.${In_FileExtension}") + #MESSAGE( "relativeFilePathsList: ${relativeFilePathsList}" ) + # Set the return value (append it to the value in the parent scope). + SET( + ${Out_FilePathsListVariableName} + "${${Out_FilePathsListVariableName}}" "${relativeFilePathsList}" + PARENT_SCOPE) +ENDFUNCTION() + +#------------------------------------------------------------------------------ +# Gets all recursive relative subdirectories. +FUNCTION(append_recursive_relative_subdirs In_RootDir Out_RecursiveRelativeSubDirsVariableName) + #MESSAGE("In_RootDir: ${In_RootDir}") + # Get all the recursive files with their relative paths. + FILE( + GLOB_RECURSE + recursiveRelativeFiles + RELATIVE "${In_RootDir}/" "${In_RootDir}/*") + #MESSAGE("recursiveRelativeFiles: ${recursiveRelativeFiles}") + + # Get the paths to all the recursive files. + # Create empty list for the case of no subdirectories being present. + SET(recursiveRelativeSubDirs) + FOREACH( + relativeFilePath + IN LISTS recursiveRelativeFiles) + GET_FILENAME_COMPONENT( + relativeSubDir + "${relativeFilePath}" + PATH) + LIST( + APPEND + recursiveRelativeSubDirs + "${relativeSubDir}") + ENDFOREACH() + #MESSAGE("recursiveRelativeSubDirs: ${recursiveRelativeSubDirs}") + + # If the list is not empty. + LIST( + LENGTH + recursiveRelativeSubDirs + recursiveRelativeSubDirsLength) + IF("${recursiveRelativeSubDirsLength}") + # Remove duplicates from the list. + LIST( + REMOVE_DUPLICATES + recursiveRelativeSubDirs) + #MESSAGE("recursiveRelativeSubDirs: ${recursiveRelativeSubDirs}") + + # Set the return value (append it to the value in the parent scope). + #MESSAGE("Out_RecursiveRelativeSubDirsVariableName: ${Out_RecursiveRelativeSubDirsVariableName}") + SET( + ${Out_RecursiveRelativeSubDirsVariableName} + "${${Out_RecursiveRelativeSubDirsVariableName}}" "${recursiveRelativeSubDirs}" + PARENT_SCOPE) + ENDIF() +ENDFUNCTION() + +#------------------------------------------------------------------------------ +# Groups the files in the same way the directories are structured. +FUNCTION(add_recursive_files_to_src_group In_RootDir In_SrcGroupIgnorePrefix In_FileExtension) + #MESSAGE("In_RootDir: ${In_RootDir}") + #MESSAGE("In_SrcGroupIgnorePrefix: ${In_SrcGroupIgnorePrefix}") + #MESSAGE("In_FileExtension: ${In_FileExtension}") + SET(recursiveRelativeSubDirs) + # Get all recursive subdirectories. + append_recursive_relative_subdirs( + "${In_RootDir}" + recursiveRelativeSubDirs) + #MESSAGE("recursiveRelativeSubDirs: ${recursiveRelativeSubDirs}") + + # For the folder itself and each sub-folder... + FOREACH( + currentRelativeSubDir + IN + LISTS recursiveRelativeSubDirs + ITEMS "") + # Appended the current subdirectory. + IF(currentRelativeSubDir STREQUAL "") + SET( + currentSubDir + "${In_RootDir}") + ELSE() + SET( + currentSubDir + "${In_RootDir}/${currentRelativeSubDir}") + ENDIF() + #MESSAGE("currentSubDir: ${currentSubDir}") + # Get all the files in this sub-folder. + SET( + wildcardFilePath + "${currentSubDir}/*.${In_FileExtension}") + #MESSAGE("wildcardFilePath: ${wildcardFilePath}") + FILE( + GLOB + filesInSubDirList + "${wildcardFilePath}") + #MESSAGE("filesInSubDirList: ${filesInSubDirList}") + + LIST( + LENGTH + filesInSubDirList + filesInSubDirListLength) + IF("${filesInSubDirListLength}") + # Group the include files into a project sub-folder analogously to the filesystem hierarchy. + SET( + groupExpression + "${currentSubDir}") + #MESSAGE("groupExpression: ${groupExpression}") + # Remove the parent directory from the path. + # NOTE: This is not correct because it does not only replace at the beginning of the string. + # "STRING(REGEX REPLACE" would be correct if there was an easy way to escape arbitrary strings. + STRING( + REPLACE "${In_SrcGroupIgnorePrefix}" "" + groupExpression + "${groupExpression}") + # Remove leading slash. + STRING( + REGEX REPLACE "^/" "" + groupExpression + "${groupExpression}") + #MESSAGE("groupExpression: ${groupExpression}") + # Replace the directory separators in the path to build valid grouping expressions. + STRING( + REPLACE "/" "\\" + groupExpression + "${groupExpression}") + #MESSAGE("groupExpression: ${groupExpression}") + SOURCE_GROUP( + "${groupExpression}" + FILES ${filesInSubDirList}) + ENDIF() + ENDFOREACH() +ENDFUNCTION() + +#------------------------------------------------------------------------------ +# Gets all files with the given ending in the given directory. +# Groups the files in the same way the directories are structured. +# This makes adding files easier because we do not have to update a list each time a file is added but this prevents CMake from detecting if it should be rerun! +FUNCTION(append_recursive_files_add_to_src_group In_RootDir In_SrcGroupIgnorePrefix In_FileExtension Out_FilePathsListVariableName) + #MESSAGE("In_RootDir: ${In_RootDir}") + #MESSAGE("In_SrcGroupIgnorePrefix: ${In_SrcGroupIgnorePrefix}") + #MESSAGE("In_FileExtension: ${In_FileExtension}") + #MESSAGE("Out_FilePathsListVariableName: ${Out_FilePathsListVariableName}") + # We have to use a local variable and give it to the parent because append_recursive_files only gives it to our scope but not the one calling this function. + SET( + allFilePathsList + "${${Out_FilePathsListVariableName}}") + append_recursive_files( + "${In_RootDir}" + "${In_FileExtension}" + allFilePathsList) + #MESSAGE( "allFilePathsList: ${allFilePathsList}" ) + # Set the return value (append it to the value in the parent scope). + SET( + ${Out_FilePathsListVariableName} + "${${Out_FilePathsListVariableName}}" "${allFilePathsList}" + PARENT_SCOPE) + + add_recursive_files_to_src_group( + "${In_RootDir}" + "${In_SrcGroupIgnorePrefix}" + "${In_FileExtension}") +ENDFUNCTION() + +#------------------------------------------------------------------------------ +# void list_add_prefix(string In_Prefix, list* In_ListVariableName); +# - returns The In_ListVariableName with In_Prefix prepended to all items. +# - original list is modified +FUNCTION(list_add_prefix In_Prefix In_ListVariableName) + SET(local_list) + + FOREACH( + item + IN LISTS ${In_ListVariableName}) + IF(POLICY CMP0054) + CMAKE_POLICY(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted. + ENDIF() + IF(NOT "${item}" STREQUAL "") + LIST( + APPEND + local_list + "${In_Prefix}${item}") + ENDIF() + ENDFOREACH() + + SET( + ${In_ListVariableName} + "${local_list}" + PARENT_SCOPE) +ENDFUNCTION() diff --git a/alpaka/cmake/dev.cmake b/alpaka/cmake/dev.cmake new file mode 100644 index 0000000000..e1ca9d99ca --- /dev/null +++ b/alpaka/cmake/dev.cmake @@ -0,0 +1,146 @@ +# +# Copyright 2014-2019 Benjamin Worpitz +# +# This file is part of Alpaka. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +#------------------------------------------------------------------------------- +# Compiler settings. +#------------------------------------------------------------------------------- +# By marking the boost headers as system headers, warnings produced within them are ignored. +# Marking the boost headers as system headers does not work for nvcc (FindCUDA always uses -I) +TARGET_INCLUDE_DIRECTORIES( + "alpaka" + SYSTEM + INTERFACE ${Boost_INCLUDE_DIRS}) + +#MSVC +IF(MSVC) + # Force to always compile with W4 and WX + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "/W4") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "/WX") + # Improve debugging. + IF(CMAKE_BUILD_TYPE MATCHES "Debug") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-d2Zi+") + ENDIF() + IF(MSVC_VERSION GREATER 1900) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "/permissive-") + IF(MSVC_VERSION GREATER 1910) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "/Zc:twoPhase-") + ENDIF() + ENDIF() + IF(MSVC_VERSION GREATER 1800) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "/Zc:throwingNew" "/Zc:strictStrings") + ENDIF() +ELSE() + IF(NOT(ALPAKA_ACC_GPU_CUDA_ENABLE) OR ALPAKA_CUDA_COMPILER MATCHES "clang" + OR(ALPAKA_ACC_GPU_HIP_ENABLE AND HIP_PLATFORM MATCHES "nvcc")) + # GNU + IF(CMAKE_COMPILER_IS_GNUCXX) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wall") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wextra") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-pedantic") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Werror") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wdouble-promotion") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wmissing-include-dirs") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wunknown-pragmas") + # Higher levels (max is 5) produce some strange warnings + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wstrict-overflow=2") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wtrampolines") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wfloat-equal") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wundef") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wshadow") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wcast-qual") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wcast-align") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wwrite-strings") + # Too noisy as it warns for every operation using numeric types smaller then int. + # Such values are converted to int implicitly before the calculation is done. + # E.g.: uint16_t = uint16_t * uint16_t will trigger the following warning: + # conversion to ‘short unsigned int’ from ‘int’ may alter its value + #LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wconversion") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wsign-conversion") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wvector-operation-performance") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wzero-as-null-pointer-constant") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wdate-time") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wuseless-cast") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wlogical-op") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wno-aggressive-loop-optimizations") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wmissing-declarations") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wno-multichar") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wopenmp-simd") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wpacked") + # Too much noise + #LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wpadded") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wredundant-decls") + # Too much noise + #LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Winline") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wdisabled-optimization") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wformat-nonliteral") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wformat-security") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wformat-y2k") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wctor-dtor-privacy") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wdelete-non-virtual-dtor") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wliteral-suffix") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wnon-virtual-dtor") + # This warns about members that have not explicitly been listed in the constructor initializer list. + # This could be useful even for members that have a default constructor. + # However, it also issues this warning for defaulted constructurs. + #LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Weffc++") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Woverloaded-virtual") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wsign-promo") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wconditionally-supported") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wnoexcept") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wold-style-cast") + IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wsuggest-final-types") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wsuggest-final-methods") + # This does not work correctly as it suggests override to methods that are already marked with final. + # Because final implies override, this is not useful. + #LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wsuggest-override") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wnormalized") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wformat-signedness") + ENDIF() + IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wnull-dereference") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wduplicated-cond") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wsubobject-linkage") + ENDIF() + IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + # This warning might be useful but it is triggered by comile-time code where it does not make any sense: + # E.g. "vec::Vec, TElem>" when both values are equal + #LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wduplicated-branches") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Walloc-zero") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Walloca") + ENDIF() + IF(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wcast-align=strict") + ENDIF() + + # Clang or AppleClang + ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Werror") + # Weverything really means everything (including Wall, Wextra, pedantic, ...) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Weverything") + # We are not C++98 compatible (we use C++11 features) + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wno-c++98-compat") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wno-c++98-compat-pedantic") + # The following warnings are triggered by all instantiations of BOOST_AUTO_TEST_SUITE + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wno-disabled-macro-expansion") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wno-global-constructors") + # This padding warning is generated by the execution tasks depending on the argument types + # as they are stored as members. Therefore, the padding warning is triggered by the calling code + # and does not indicate a failure within alpaka. + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wno-padded") + # ICC + ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Wall") + # PGI + ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "PGI") + LIST(APPEND ALPAKA_DEV_COMPILE_OPTIONS "-Minform=inform") + ENDIF() + ENDIF() +ENDIF() diff --git a/alpaka/cmake/modules/FindHIP.cmake b/alpaka/cmake/modules/FindHIP.cmake new file mode 100644 index 0000000000..dd55e18228 --- /dev/null +++ b/alpaka/cmake/modules/FindHIP.cmake @@ -0,0 +1,601 @@ +# /* +# Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# */ + +############################################################################### +# FindHIP.cmake +############################################################################### + +############################################################################### +# SET: Variable defaults +############################################################################### +# User defined flags +set(HIP_HIPCC_FLAGS "" CACHE STRING "Semicolon delimited flags for HIPCC") +set(HIP_HCC_FLAGS "" CACHE STRING "Semicolon delimited flags for HCC") +set(HIP_NVCC_FLAGS "" CACHE STRING "Semicolon delimted flags for NVCC") +mark_as_advanced(HIP_HIPCC_FLAGS HIP_HCC_FLAGS HIP_NVCC_FLAGS) +set(_hip_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) +list(REMOVE_DUPLICATES _hip_configuration_types) +foreach(config ${_hip_configuration_types}) + string(TOUPPER ${config} config_upper) + set(HIP_HIPCC_FLAGS_${config_upper} "" CACHE STRING "Semicolon delimited flags for HIPCC") + set(HIP_HCC_FLAGS_${config_upper} "" CACHE STRING "Semicolon delimited flags for HCC") + set(HIP_NVCC_FLAGS_${config_upper} "" CACHE STRING "Semicolon delimited flags for NVCC") + mark_as_advanced(HIP_HIPCC_FLAGS_${config_upper} HIP_HCC_FLAGS_${config_upper} HIP_NVCC_FLAGS_${config_upper}) +endforeach() +option(HIP_HOST_COMPILATION_CPP "Host code compilation mode" ON) +option(HIP_VERBOSE_BUILD "Print out the commands run while compiling the HIP source file. With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF) +mark_as_advanced(HIP_HOST_COMPILATION_CPP) + +############################################################################### +# Set HIP CMAKE Flags +############################################################################### +# Copy the invocation styles from CXX to HIP +set(CMAKE_HIP_ARCHIVE_CREATE ${CMAKE_CXX_ARCHIVE_CREATE}) +set(CMAKE_HIP_ARCHIVE_APPEND ${CMAKE_CXX_ARCHIVE_APPEND}) +set(CMAKE_HIP_ARCHIVE_FINISH ${CMAKE_CXX_ARCHIVE_FINISH}) +set(CMAKE_SHARED_LIBRARY_SONAME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG}) +set(CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}) +set(CMAKE_SHARED_LIBRARY_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) +#set(CMAKE_SHARED_LIBRARY_LINK_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}) +set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG}) +set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP}) +set(CMAKE_SHARED_LIBRARY_LINK_STATIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_STATIC_CXX_FLAGS}) +set(CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_CXX_FLAGS}) + +# Set the CMake Flags to use the HCC Compilier. +set(CMAKE_HIP_CREATE_SHARED_LIBRARY "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_PATH} -o ") +set(CMAKE_HIP_CREATE_SHARED_MODULE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_PATH} -o -shared" ) +set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_PATH} -o ") + +############################################################################### +# FIND: HIP and associated helper binaries +############################################################################### +# HIP is supported on Linux only +if(UNIX AND NOT APPLE AND NOT CYGWIN) + # Search for HIP installation + if(NOT HIP_ROOT_DIR) + # Search in user specified path first + find_path( + HIP_ROOT_DIR + NAMES hipconfig + PATHS + ENV ROCM_PATH + ENV HIP_PATH + PATH_SUFFIXES bin + DOC "HIP installed location" + NO_DEFAULT_PATH + ) + # Now search in default path + find_path( + HIP_ROOT_DIR + NAMES hipconfig + PATHS + /opt/rocm + /opt/rocm/hip + PATH_SUFFIXES bin + DOC "HIP installed location" + ) + + # Check if we found HIP installation + if(HIP_ROOT_DIR) + # If so, fix the path + string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" HIP_ROOT_DIR ${HIP_ROOT_DIR}) + # And push it back to the cache + set(HIP_ROOT_DIR ${HIP_ROOT_DIR} CACHE PATH "HIP installed location" FORCE) + endif() + if(NOT EXISTS ${HIP_ROOT_DIR}) + if(HIP_FIND_REQUIRED) + message(FATAL_ERROR "Specify HIP_ROOT_DIR") + elseif(NOT HIP_FIND_QUIETLY) + message("HIP_ROOT_DIR not found or specified") + endif() + endif() + endif() + + # Find HIPCC executable + find_program( + HIP_HIPCC_EXECUTABLE + NAMES hipcc + PATHS + "${HIP_ROOT_DIR}" + ENV ROCM_PATH + ENV HIP_PATH + /opt/rocm + /opt/rocm/hip + PATH_SUFFIXES bin + NO_DEFAULT_PATH + ) + if(NOT HIP_HIPCC_EXECUTABLE) + # Now search in default paths + find_program(HIP_HIPCC_EXECUTABLE hipcc) + endif() + mark_as_advanced(HIP_HIPCC_EXECUTABLE) + + # Find HIPCONFIG executable + find_program( + HIP_HIPCONFIG_EXECUTABLE + NAMES hipconfig + PATHS + "${HIP_ROOT_DIR}" + ENV ROCM_PATH + ENV HIP_PATH + /opt/rocm + /opt/rocm/hip + PATH_SUFFIXES bin + NO_DEFAULT_PATH + ) + if(NOT HIP_HIPCONFIG_EXECUTABLE) + # Now search in default paths + find_program(HIP_HIPCONFIG_EXECUTABLE hipconfig) + endif() + mark_as_advanced(HIP_HIPCONFIG_EXECUTABLE) + + # Find HIPCC_CMAKE_LINKER_HELPER executable + find_program( + HIP_HIPCC_CMAKE_LINKER_HELPER + NAMES hipcc_cmake_linker_helper + PATHS + "${HIP_ROOT_DIR}" + ENV ROCM_PATH + ENV HIP_PATH + /opt/rocm + /opt/rocm/hip + PATH_SUFFIXES bin + NO_DEFAULT_PATH + ) + if(NOT HIP_HIPCC_CMAKE_LINKER_HELPER) + # Now search in default paths + find_program(HIP_HIPCC_CMAKE_LINKER_HELPER hipcc_cmake_linker_helper) + endif() + mark_as_advanced(HIP_HIPCC_CMAKE_LINKER_HELPER) + + if(HIP_HIPCONFIG_EXECUTABLE AND NOT HIP_VERSION) + # Compute the version + execute_process( + COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --version + OUTPUT_VARIABLE _hip_version + ERROR_VARIABLE _hip_error + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(NOT _hip_error) + set(HIP_VERSION ${_hip_version} CACHE STRING "Version of HIP as computed from hipcc") + else() + set(HIP_VERSION "0.0.0" CACHE STRING "Version of HIP as computed by FindHIP()") + endif() + mark_as_advanced(HIP_VERSION) + endif() + if(HIP_VERSION) + string(REPLACE "." ";" _hip_version_list "${HIP_VERSION}") + list(GET _hip_version_list 0 HIP_VERSION_MAJOR) + list(GET _hip_version_list 1 HIP_VERSION_MINOR) + list(GET _hip_version_list 2 HIP_VERSION_PATCH) + set(HIP_VERSION_STRING "${HIP_VERSION}") + endif() + + if(HIP_HIPCONFIG_EXECUTABLE AND NOT HIP_PLATFORM) + # Compute the platform + execute_process( + COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --platform + OUTPUT_VARIABLE _hip_platform + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(HIP_PLATFORM ${_hip_platform} CACHE STRING "HIP platform as computed by hipconfig") + mark_as_advanced(HIP_PLATFORM) + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + HIP + REQUIRED_VARS + HIP_ROOT_DIR + HIP_HIPCC_EXECUTABLE + HIP_HIPCONFIG_EXECUTABLE + HIP_PLATFORM + VERSION_VAR HIP_VERSION + ) + +############################################################################### +# MACRO: Locate helper files +############################################################################### +macro(HIP_FIND_HELPER_FILE _name _extension) + set(_hip_full_name "${_name}.${_extension}") + get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + set(HIP_${_name} "${CMAKE_CURRENT_LIST_DIR}/FindHIP/${_hip_full_name}") + if(NOT EXISTS "${HIP_${_name}}") + set(error_message "${_hip_full_name} not found in ${CMAKE_CURRENT_LIST_DIR}/FindHIP") + if(HIP_FIND_REQUIRED) + message(FATAL_ERROR "${error_message}") + else() + if(NOT HIP_FIND_QUIETLY) + message(STATUS "${error_message}") + endif() + endif() + endif() + # Set this variable as internal, so the user isn't bugged with it. + set(HIP_${_name} ${HIP_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) +endmacro() + +############################################################################### +hip_find_helper_file(run_make2cmake cmake) +hip_find_helper_file(run_hipcc cmake) +############################################################################### + +############################################################################### +# MACRO: Reset compiler flags +############################################################################### +macro(HIP_RESET_FLAGS) + unset(HIP_HIPCC_FLAGS) + unset(HIP_HCC_FLAGS) + unset(HIP_NVCC_FLAGS) + foreach(config ${_hip_configuration_types}) + string(TOUPPER ${config} config_upper) + unset(HIP_HIPCC_FLAGS_${config_upper}) + unset(HIP_HCC_FLAGS_${config_upper}) + unset(HIP_NVCC_FLAGS_${config_upper}) + endforeach() +endmacro() + +############################################################################### +# MACRO: Separate the options from the sources +############################################################################### +macro(HIP_GET_SOURCES_AND_OPTIONS _sources _cmake_options _hipcc_options _hcc_options _nvcc_options) + set(${_sources}) + set(${_cmake_options}) + set(${_hipcc_options}) + set(${_hcc_options}) + set(${_nvcc_options}) + set(_hipcc_found_options FALSE) + set(_hcc_found_options FALSE) + set(_nvcc_found_options FALSE) + foreach(arg ${ARGN}) + if("x${arg}" STREQUAL "xHIPCC_OPTIONS") + set(_hipcc_found_options TRUE) + set(_hcc_found_options FALSE) + set(_nvcc_found_options FALSE) + elseif("x${arg}" STREQUAL "xHCC_OPTIONS") + set(_hipcc_found_options FALSE) + set(_hcc_found_options TRUE) + set(_nvcc_found_options FALSE) + elseif("x${arg}" STREQUAL "xNVCC_OPTIONS") + set(_hipcc_found_options FALSE) + set(_hcc_found_options FALSE) + set(_nvcc_found_options TRUE) + elseif( + "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR + "x${arg}" STREQUAL "xSTATIC" OR + "x${arg}" STREQUAL "xSHARED" OR + "x${arg}" STREQUAL "xMODULE" + ) + list(APPEND ${_cmake_options} ${arg}) + else() + if(_hipcc_found_options) + list(APPEND ${_hipcc_options} ${arg}) + elseif(_hcc_found_options) + list(APPEND ${_hcc_options} ${arg}) + elseif(_nvcc_found_options) + list(APPEND ${_nvcc_options} ${arg}) + else() + # Assume this is a file + list(APPEND ${_sources} ${arg}) + endif() + endif() + endforeach() +endmacro() + +############################################################################### +# MACRO: Add include directories to pass to the hipcc command +############################################################################### +set(HIP_HIPCC_INCLUDE_ARGS_USER "") +macro(HIP_INCLUDE_DIRECTORIES) + foreach(dir ${ARGN}) + list(APPEND HIP_HIPCC_INCLUDE_ARGS_USER $<$:-I${dir}>) + endforeach() +endmacro() + +############################################################################### +# FUNCTION: Helper to avoid clashes of files with the same basename but different paths +############################################################################### +function(HIP_COMPUTE_BUILD_PATH path build_path) + # Convert to cmake style paths + file(TO_CMAKE_PATH "${path}" bpath) + if(IS_ABSOLUTE "${bpath}") + string(FIND "${bpath}" "${CMAKE_CURRENT_BINARY_DIR}" _binary_dir_pos) + if(_binary_dir_pos EQUAL 0) + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_BINARY_DIR}" "${bpath}") + else() + file(RELATIVE_PATH bpath "${CMAKE_CURRENT_SOURCE_DIR}" "${bpath}") + endif() + endif() + + # Remove leading / + string(REGEX REPLACE "^[/]+" "" bpath "${bpath}") + # Avoid absolute paths by removing ':' + string(REPLACE ":" "_" bpath "${bpath}") + # Avoid relative paths that go up the tree + string(REPLACE "../" "__/" bpath "${bpath}") + # Avoid spaces + string(REPLACE " " "_" bpath "${bpath}") + # Strip off the filename + get_filename_component(bpath "${bpath}" PATH) + + set(${build_path} "${bpath}" PARENT_SCOPE) +endfunction() + +############################################################################### +# MACRO: Parse OPTIONS from ARGN & set variables prefixed by _option_prefix +############################################################################### +macro(HIP_PARSE_HIPCC_OPTIONS _option_prefix) + set(_hip_found_config) + foreach(arg ${ARGN}) + # Determine if we are dealing with a per-configuration flag + foreach(config ${_hip_configuration_types}) + string(TOUPPER ${config} config_upper) + if(arg STREQUAL "${config_upper}") + set(_hip_found_config _${arg}) + # Clear arg to prevent it from being processed anymore + set(arg) + endif() + endforeach() + if(arg) + list(APPEND ${_option_prefix}${_hip_found_config} "${arg}") + endif() + endforeach() +endmacro() + +############################################################################### +# MACRO: Try and include dependency file if it exists +############################################################################### +macro(HIP_INCLUDE_HIPCC_DEPENDENCIES dependency_file) + set(HIP_HIPCC_DEPEND) + set(HIP_HIPCC_DEPEND_REGENERATE FALSE) + + # Create the dependency file if it doesn't exist + if(NOT EXISTS ${dependency_file}) + file(WRITE ${dependency_file} "# Generated by: FindHIP.cmake. Do not edit.\n") + endif() + # Include the dependency file + include(${dependency_file}) + + # Verify the existence of all the included files + if(HIP_HIPCC_DEPEND) + foreach(f ${HIP_HIPCC_DEPEND}) + if(NOT EXISTS ${f}) + # If they aren't there, regenerate the file again + set(HIP_HIPCC_DEPEND_REGENERATE TRUE) + endif() + endforeach() + else() + # No dependencies, so regenerate the file + set(HIP_HIPCC_DEPEND_REGENERATE TRUE) + endif() + + # Regenerate the dependency file if needed + if(HIP_HIPCC_DEPEND_REGENERATE) + set(HIP_HIPCC_DEPEND ${dependency_file}) + file(WRITE ${dependency_file} "# Generated by: FindHIP.cmake. Do not edit.\n") + endif() +endmacro() + +############################################################################### +# MACRO: Prepare cmake commands for the target +############################################################################### +macro(HIP_PREPARE_TARGET_COMMANDS _target _format _generated_files _source_files) + set(_hip_flags "") + string(TOUPPER "${CMAKE_BUILD_TYPE}" _hip_build_configuration) + if(HIP_HOST_COMPILATION_CPP) + set(HIP_C_OR_CXX CXX) + else() + set(HIP_C_OR_CXX C) + endif() + set(generated_extension ${CMAKE_${HIP_C_OR_CXX}_OUTPUT_EXTENSION}) + + # Initialize list of includes with those specified by the user. Append with + # ones specified to cmake directly. + set(HIP_HIPCC_INCLUDE_ARGS ${HIP_HIPCC_INCLUDE_ARGS_USER}) + + # Add the include directories + set(include_directories_generator "$") + list(APPEND HIP_HIPCC_INCLUDE_ARGS "$<$:-I$>") + + get_directory_property(_hip_include_directories INCLUDE_DIRECTORIES) + list(REMOVE_DUPLICATES _hip_include_directories) + if(_hip_include_directories) + foreach(dir ${_hip_include_directories}) + list(APPEND HIP_HIPCC_INCLUDE_ARGS $<$:-I${dir}>) + endforeach() + endif() + + HIP_GET_SOURCES_AND_OPTIONS(_hip_sources _hip_cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN}) + HIP_PARSE_HIPCC_OPTIONS(HIP_HIPCC_FLAGS ${_hipcc_options}) + HIP_PARSE_HIPCC_OPTIONS(HIP_HCC_FLAGS ${_hcc_options}) + HIP_PARSE_HIPCC_OPTIONS(HIP_NVCC_FLAGS ${_nvcc_options}) + + # Add the compile definitions + set(compile_definition_generator "$") + list(APPEND HIP_HIPCC_FLAGS "$<$:-D$>") + + # Check if we are building shared library. + set(_hip_build_shared_libs FALSE) + list(FIND _hip_cmake_options SHARED _hip_found_SHARED) + list(FIND _hip_cmake_options MODULE _hip_found_MODULE) + if(_hip_found_SHARED GREATER -1 OR _hip_found_MODULE GREATER -1) + set(_hip_build_shared_libs TRUE) + endif() + list(FIND _hip_cmake_options STATIC _hip_found_STATIC) + if(_hip_found_STATIC GREATER -1) + set(_hip_build_shared_libs FALSE) + endif() + + # If we are building a shared library, add extra flags to HIP_HIPCC_FLAGS + if(_hip_build_shared_libs) + list(APPEND HIP_HCC_FLAGS "-fPIC") + list(APPEND HIP_NVCC_FLAGS "--shared -Xcompiler '-fPIC'") + endif() + + # Set host compiler + set(HIP_HOST_COMPILER "${CMAKE_${HIP_C_OR_CXX}_COMPILER}") + + # Set compiler flags + set(_HIP_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CMAKE_${HIP_C_OR_CXX}_FLAGS})") + set(_HIP_HIPCC_FLAGS "set(HIP_HIPCC_FLAGS ${HIP_HIPCC_FLAGS})") + set(_HIP_HCC_FLAGS "set(HIP_HCC_FLAGS ${HIP_HCC_FLAGS})") + set(_HIP_NVCC_FLAGS "set(HIP_NVCC_FLAGS ${HIP_NVCC_FLAGS})") + foreach(config ${_hip_configuration_types}) + string(TOUPPER ${config} config_upper) + set(_HIP_HOST_FLAGS "${_HIP_HOST_FLAGS}\nset(CMAKE_HOST_FLAGS_${config_upper} ${CMAKE_${HIP_C_OR_CXX}_FLAGS_${config_upper}})") + set(_HIP_HIPCC_FLAGS "${_HIP_HIPCC_FLAGS}\nset(HIP_HIPCC_FLAGS_${config_upper} ${HIP_HIPCC_FLAGS_${config_upper}})") + set(_HIP_HCC_FLAGS "${_HIP_HCC_FLAGS}\nset(HIP_HCC_FLAGS_${config_upper} ${HIP_HCC_FLAGS_${config_upper}})") + set(_HIP_NVCC_FLAGS "${_HIP_NVCC_FLAGS}\nset(HIP_NVCC_FLAGS_${config_upper} ${HIP_NVCC_FLAGS_${config_upper}})") + endforeach() + + # Reset the output variable + set(_hip_generated_files "") + set(_hip_source_files "") + + # Iterate over all arguments and create custom commands for all source files + foreach(file ${ARGN}) + # Ignore any file marked as a HEADER_FILE_ONLY + get_source_file_property(_is_header ${file} HEADER_FILE_ONLY) + # Allow per source file overrides of the format. Also allows compiling non .cu files. + get_source_file_property(_hip_source_format ${file} HIP_SOURCE_PROPERTY_FORMAT) + if((${file} MATCHES "\\.cu$" OR _hip_source_format) AND NOT _is_header) + set(host_flag FALSE) + else() + set(host_flag TRUE) + endif() + + if(NOT host_flag) + # Determine output directory + HIP_COMPUTE_BUILD_PATH("${file}" hip_build_path) + set(hip_compile_output_dir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}.dir/${hip_build_path}") + + get_filename_component(basename ${file} NAME) + set(generated_file_path "${hip_compile_output_dir}/${CMAKE_CFG_INTDIR}") + set(generated_file_basename "${_target}_generated_${basename}${generated_extension}") + + # Set file names + set(generated_file "${generated_file_path}/${generated_file_basename}") + set(cmake_dependency_file "${hip_compile_output_dir}/${generated_file_basename}.depend") + set(custom_target_script_pregen "${hip_compile_output_dir}/${generated_file_basename}.cmake.pre-gen") + set(custom_target_script "${hip_compile_output_dir}/${generated_file_basename}.cmake") + + # Set properties for object files + set_source_files_properties("${generated_file}" + PROPERTIES + EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked + ) + + # Don't add CMAKE_CURRENT_SOURCE_DIR if the path is already an absolute path + get_filename_component(file_path "${file}" PATH) + if(IS_ABSOLUTE "${file_path}") + set(source_file "${file}") + else() + set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${file}") + endif() + + # Bring in the dependencies + HIP_INCLUDE_HIPCC_DEPENDENCIES(${cmake_dependency_file}) + + # Configure the build script + configure_file("${HIP_run_hipcc}" "${custom_target_script_pregen}" @ONLY) + file(GENERATE + OUTPUT "${custom_target_script}" + INPUT "${custom_target_script_pregen}" + ) + set(main_dep DEPENDS ${source_file}) + if(CMAKE_GENERATOR MATCHES "Makefiles") + set(verbose_output "$(VERBOSE)") + elseif(HIP_VERBOSE_BUILD) + set(verbose_output ON) + else() + set(verbose_output OFF) + endif() + + # Create up the comment string + file(RELATIVE_PATH generated_file_relative_path "${CMAKE_BINARY_DIR}" "${generated_file}") + set(hip_build_comment_string "Building HIPCC object ${generated_file_relative_path}") + + # Build the generated file and dependency file + add_custom_command( + OUTPUT ${generated_file} + # These output files depend on the source_file and the contents of cmake_dependency_file + ${main_dep} + DEPENDS ${HIP_HIPCC_DEPEND} + DEPENDS ${custom_target_script} + # Make sure the output directory exists before trying to write to it. + COMMAND ${CMAKE_COMMAND} -E make_directory "${generated_file_path}" + COMMAND ${CMAKE_COMMAND} ARGS + -D verbose:BOOL=${verbose_output} + -D build_configuration:STRING=${_hip_build_configuration} + -D "generated_file:STRING=${generated_file}" + -P "${custom_target_script}" + WORKING_DIRECTORY "${hip_compile_output_dir}" + COMMENT "${hip_build_comment_string}" + ) + + # Make sure the build system knows the file is generated + set_source_files_properties(${generated_file} PROPERTIES GENERATED TRUE) + list(APPEND _hip_generated_files ${generated_file}) + list(APPEND _hip_source_files ${file}) + endif() + endforeach() + + # Set the return parameter + set(${_generated_files} ${_hip_generated_files}) + set(${_source_files} ${_hip_source_files}) +endmacro() + +############################################################################### +# HIP_ADD_EXECUTABLE +############################################################################### +macro(HIP_ADD_EXECUTABLE hip_target) + # Separate the sources from the options + HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN}) + HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options}) + if(_source_files) + list(REMOVE_ITEM _sources ${_source_files}) + endif() + if("x${HCC_HOME}" STREQUAL "x") + set(HCC_HOME "/opt/rocm/hcc") + endif() + set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HCC_HOME} -o ") + add_executable(${hip_target} ${_cmake_options} ${_generated_files} ${_sources}) + set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE HIP) +endmacro() + +############################################################################### +# HIP_ADD_LIBRARY +############################################################################### +macro(HIP_ADD_LIBRARY hip_target) + # Separate the sources from the options + HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN}) + HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files _source_files ${_sources} ${_cmake_options} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options}) + if(_source_files) + list(REMOVE_ITEM _sources ${_source_files}) + endif() + add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources}) + set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX}) +endmacro() + +# vim: ts=4:sw=4:expandtab:smartindent diff --git a/alpaka/cmake/modules/FindHIP/run_hipcc.cmake b/alpaka/cmake/modules/FindHIP/run_hipcc.cmake new file mode 100644 index 0000000000..c9582bdbd4 --- /dev/null +++ b/alpaka/cmake/modules/FindHIP/run_hipcc.cmake @@ -0,0 +1,190 @@ +# /* +# Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# */ + +############################################################################### +# Runs commands using HIPCC +############################################################################### + +############################################################################### +# This file runs the hipcc commands to produce the desired output file +# along with the dependency file needed by CMake to compute dependencies. +# +# Input variables: +# +# verbose:BOOL=<> OFF: Be as quiet as possible (default) +# ON : Describe each step +# build_configuration:STRING=<> Build configuration. Defaults to Debug. +# generated_file:STRING=<> File to generate. Mandatory argument. + +if(NOT build_configuration) + set(build_configuration Debug) +endif() +if(NOT generated_file) + message(FATAL_ERROR "You must specify generated_file on the command line") +endif() + +# Set these up as variables to make reading the generated file easier +set(HIP_HIPCC_EXECUTABLE "@HIP_HIPCC_EXECUTABLE@") # path +set(HIP_HIPCONFIG_EXECUTABLE "@HIP_HIPCONFIG_EXECUTABLE@") #path +set(HIP_HOST_COMPILER "@HIP_HOST_COMPILER@") # path +set(CMAKE_COMMAND "@CMAKE_COMMAND@") # path +set(HIP_run_make2cmake "@HIP_run_make2cmake@") # path +set(HCC_HOME "@HCC_HOME@") #path + +@HIP_HOST_FLAGS@ +@_HIP_HIPCC_FLAGS@ +@_HIP_HCC_FLAGS@ +@_HIP_NVCC_FLAGS@ +set(HIP_HIPCC_INCLUDE_ARGS "@HIP_HIPCC_INCLUDE_ARGS@") # list (needs to be in quotes to handle spaces properly) + +set(cmake_dependency_file "@cmake_dependency_file@") # path +set(source_file "@source_file@") # path +set(host_flag "@host_flag@") # bool + +# Determine compiler and compiler flags +execute_process(COMMAND ${HIP_HIPCONFIG_EXECUTABLE} --platform OUTPUT_VARIABLE HIP_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE) +if(NOT host_flag) + set(__CC ${HIP_HIPCC_EXECUTABLE}) + if(HIP_PLATFORM STREQUAL "hcc") + if(NOT "x${HCC_HOME}" STREQUAL "x") + set(ENV{HCC_HOME} ${HCC_HOME}) + endif() + set(__CC_FLAGS ${HIP_HIPCC_FLAGS} ${HIP_HCC_FLAGS} ${HIP_HIPCC_FLAGS_${build_configuration}} ${HIP_HCC_FLAGS_${build_configuration}}) + else() + set(__CC_FLAGS ${HIP_HIPCC_FLAGS} ${HIP_NVCC_FLAGS} ${HIP_HIPCC_FLAGS_${build_configuration}} ${HIP_NVCC_FLAGS_${build_configuration}}) + endif() +else() + set(__CC ${HIP_HOST_COMPILER}) + set(__CC_FLAGS ${CMAKE_HOST_FLAGS} ${CMAKE_HOST_FLAGS_${build_configuration}}) +endif() +set(__CC_INCLUDES ${HIP_HIPCC_INCLUDE_ARGS}) + +# hip_execute_process - Executes a command with optional command echo and status message. +# status - Status message to print if verbose is true +# command - COMMAND argument from the usual execute_process argument structure +# ARGN - Remaining arguments are the command with arguments +# HIP_result - Return value from running the command +macro(hip_execute_process status command) + set(_command ${command}) + if(NOT "x${_command}" STREQUAL "xCOMMAND") + message(FATAL_ERROR "Malformed call to hip_execute_process. Missing COMMAND as second argument. (command = ${command})") + endif() + if(verbose) + execute_process(COMMAND "${CMAKE_COMMAND}" -E echo -- ${status}) + # Build command string to print + set(hip_execute_process_string) + foreach(arg ${ARGN}) + # Escape quotes if any + string(REPLACE "\"" "\\\"" arg ${arg}) + # Surround args with spaces with quotes + if(arg MATCHES " ") + list(APPEND hip_execute_process_string "\"${arg}\"") + else() + list(APPEND hip_execute_process_string ${arg}) + endif() + endforeach() + # Echo the command + execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${hip_execute_process_string}) + endif() + # Run the command + execute_process(COMMAND ${ARGN} RESULT_VARIABLE HIP_result) +endmacro() + +# Delete the target file +hip_execute_process( + "Removing ${generated_file}" + COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}" + ) + +# Generate the dependency file +hip_execute_process( + "Generating dependency file: ${cmake_dependency_file}.pre" + COMMAND "${__CC}" + -M + "${source_file}" + -o "${cmake_dependency_file}.pre" + ${__CC_FLAGS} + ${__CC_INCLUDES} + ) + +if(HIP_result) + message(FATAL_ERROR "Error generating ${generated_file}") +endif() + +# Generate the cmake readable dependency file to a temp file +hip_execute_process( + "Generating temporary cmake readable file: ${cmake_dependency_file}.tmp" + COMMAND "${CMAKE_COMMAND}" + -D "input_file:FILEPATH=${cmake_dependency_file}.pre" + -D "output_file:FILEPATH=${cmake_dependency_file}.tmp" + -D "verbose=${verbose}" + -P "${HIP_run_make2cmake}" + ) + +if(HIP_result) + message(FATAL_ERROR "Error generating ${generated_file}") +endif() + +# Copy the file if it is different +hip_execute_process( + "Copy if different ${cmake_dependency_file}.tmp to ${cmake_dependency_file}" + COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${cmake_dependency_file}.tmp" "${cmake_dependency_file}" + ) + +if(HIP_result) + message(FATAL_ERROR "Error generating ${generated_file}") +endif() + +# Delete the temporary file +hip_execute_process( + "Removing ${cmake_dependency_file}.tmp and ${cmake_dependency_file}.pre" + COMMAND "${CMAKE_COMMAND}" -E remove "${cmake_dependency_file}.tmp" "${cmake_dependency_file}.pre" + ) + +if(HIP_result) + message(FATAL_ERROR "Error generating ${generated_file}") +endif() + +# Generate the output file +hip_execute_process( + "Generating ${generated_file}" + COMMAND "${__CC}" + -c + "${source_file}" + -o "${generated_file}" + ${__CC_FLAGS} + ${__CC_INCLUDES} + ) + +if(HIP_result) + # Make sure that we delete the output file + hip_execute_process( + "Removing ${generated_file}" + COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}" + ) + message(FATAL_ERROR "Error generating file ${generated_file}") +else() + if(verbose) + message("Generated ${generated_file} successfully.") + endif() +endif() +# vim: ts=4:sw=4:expandtab:smartindent diff --git a/alpaka/cmake/modules/FindHIP/run_make2cmake.cmake b/alpaka/cmake/modules/FindHIP/run_make2cmake.cmake new file mode 100644 index 0000000000..48a51fa039 --- /dev/null +++ b/alpaka/cmake/modules/FindHIP/run_make2cmake.cmake @@ -0,0 +1,72 @@ +# /* +# Copyright (c) 2015-2016 Advanced Micro Devices, Inc. All rights reserved. + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# */ + +############################################################################### +# Computes dependencies using HIPCC +############################################################################### + +############################################################################### +# This file converts dependency files generated using hipcc to a format that +# cmake can understand. + +# Input variables: +# +# input_file:STRING=<> Dependency file to parse. Required argument +# output_file:STRING=<> Output file to generate. Required argument + +if(NOT input_file OR NOT output_file) + message(FATAL_ERROR "You must specify input_file and output_file on the command line") +endif() + +file(READ ${input_file} depend_text) + +if (NOT "${depend_text}" STREQUAL "") + string(REPLACE " /" "\n/" depend_text ${depend_text}) + string(REGEX REPLACE "^.*:" "" depend_text ${depend_text}) + string(REGEX REPLACE "[ \\\\]*\n" ";" depend_text ${depend_text}) + + set(dependency_list "") + + foreach(file ${depend_text}) + string(REGEX REPLACE "^ +" "" file ${file}) + if(NOT EXISTS "${file}") + message(WARNING " Removing non-existent dependency file: ${file}") + set(file "") + endif() + + if(NOT IS_DIRECTORY "${file}") + get_filename_component(file_absolute "${file}" ABSOLUTE) + list(APPEND dependency_list "${file_absolute}") + endif() + endforeach() +endif() + +# Remove the duplicate entries and sort them. +list(REMOVE_DUPLICATES dependency_list) +list(SORT dependency_list) + +foreach(file ${dependency_list}) + set(hip_hipcc_depend "${hip_hipcc_depend} \"${file}\"\n") +endforeach() + +file(WRITE ${output_file} "# Generated by: FindHIP.cmake. Do not edit.\nSET(HIP_HIPCC_DEPEND\n ${hip_hipcc_depend})\n\n") +# vim: ts=4:sw=4:expandtab:smartindent diff --git a/alpaka/cmake/modules/FindTBB.cmake b/alpaka/cmake/modules/FindTBB.cmake new file mode 100644 index 0000000000..4cfabee852 --- /dev/null +++ b/alpaka/cmake/modules/FindTBB.cmake @@ -0,0 +1,246 @@ +# The MIT License (MIT) +# +# Copyright (c) 2015 Justus Calvin +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +# +# FindTBB +# ------- +# +# Find TBB include directories and libraries. +# +# Usage: +# +# find_package(TBB [major[.minor]] [EXACT] +# [QUIET] [REQUIRED] +# [[COMPONENTS] [components...]] +# [OPTIONAL_COMPONENTS components...]) +# +# where the allowed components are tbbmalloc and tbb_preview. Users may modify +# the behavior of this module with the following variables: +# +# * TBB_ROOT_DIR - The base directory the of TBB installation. +# * TBB_INCLUDE_DIR - The directory that contains the TBB headers files. +# * TBB_LIBRARY - The directory that contains the TBB library files. +# * TBB__LIBRARY - The path of the TBB the corresponding TBB library. +# These libraries, if specified, override the +# corresponding library search results, where +# may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug, +# tbb_preview, or tbb_preview_debug. +# * TBB_USE_DEBUG_BUILD - The debug version of tbb libraries, if present, will +# be used instead of the release version. +# +# Users may modify the behavior of this module with the following environment +# variables: +# +# * TBB_INSTALL_DIR +# * TBBROOT +# * LIBRARY_PATH +# +# This module will set the following variables: +# +# * TBB_FOUND - Set to false, or undefined, if we haven’t found, or +# don’t want to use TBB. +# * TBB__FOUND - If False, optional part of TBB sytem is +# not available. +# * TBB_VERSION - The full version string +# * TBB_VERSION_MAJOR - The major version +# * TBB_VERSION_MINOR - The minor version +# * TBB_INTERFACE_VERSION - The interface version number defined in +# tbb/tbb_stddef.h. +# * TBB__LIBRARY_RELEASE - The path of the TBB release version of +# , where may be tbb, tbb_debug, +# tbbmalloc, tbbmalloc_debug, tbb_preview, or +# tbb_preview_debug. +# * TBB__LIBRARY_DEGUG - The path of the TBB release version of +# , where may be tbb, tbb_debug, +# tbbmalloc, tbbmalloc_debug, tbb_preview, or +# tbb_preview_debug. +# +# The following varibles should be used to build and link with TBB: +# +# * TBB_INCLUDE_DIRS - The include directory for TBB. +# * TBB_LIBRARIES - The libraries to link against to use TBB. +# * TBB_DEFINITIONS - Definitions to use when compiling code that uses TBB. + +include(FindPackageHandleStandardArgs) + +if(NOT TBB_FOUND) + + ################################## + # Check the build type + ################################## + + if(NOT DEFINED TBB_USE_DEBUG_BUILD) + if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + message(STATUS "Set TBB_USE_DEBUG_BUILD to TRUE because CMAKE_BUILD_TYPE is one of the debug configurations.") + set(TBB_USE_DEBUG_BUILD TRUE) + else() + set(TBB_USE_DEBUG_BUILD FALSE) + endif() + endif() + + ################################## + # Set the TBB search directories + ################################## + + # Define search paths based on user input and environment variables + set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT}) + + # Define the search directories based on the current platform + if(CMAKE_SYSTEM_NAME STREQUAL "Windows") + set(TBB_DEFAULT_SEARCH_DIR "C:/Program Files/Intel/TBB" + "C:/Program Files (x86)/Intel/TBB") + + # Set the target architecture + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(TBB_ARCHITECTURE "intel64") + else() + set(TBB_ARCHITECTURE "ia32") + endif() + + # Set the TBB search library path search suffix based on the version of VC + if(WINDOWS_STORE) + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11_ui") + elseif(MSVC14) + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc14") + elseif(MSVC12) + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc12") + elseif(MSVC11) + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11") + elseif(MSVC10) + set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc10") + endif() + + # Add the library path search suffix for the VC independent version of TBB + list(APPEND TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc_mt") + + elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + # OS X + set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") + + # TODO: Check to see which C++ library is being used by the compiler. + if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0) + # The default C++ library on OS X 10.9 and later is libc++ + set(TBB_LIB_PATH_SUFFIX "lib/libc++") + else() + set(TBB_LIB_PATH_SUFFIX "lib") + endif() + elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Linux + set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") + + # TODO: Check compiler version to see the suffix should be /gcc4.1 or + # /gcc4.1. For now, assume that the compiler is more recent than + # gcc 4.4.x or later. + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(TBB_LIB_PATH_SUFFIX "lib/intel64/gcc4.4") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") + set(TBB_LIB_PATH_SUFFIX "lib/ia32/gcc4.4") + endif() + endif() + + ################################## + # Find the TBB include dir + ################################## + + find_path(TBB_INCLUDE_DIRS tbb/tbb.h + HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR} + PATHS ${TBB_DEFAULT_SEARCH_DIR} + PATH_SUFFIXES include) + + ################################## + # Find TBB components + ################################## + + # Find each component + foreach(_comp tbb_preview tbbmalloc tbb) + # Search for the libraries + find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp} + HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} + PATHS ${TBB_DEFAULT_SEARCH_DIR} + PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) + + find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug + HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} + PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH + PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) + + # Set the library to be used for the component + if(NOT TBB_${_comp}_LIBRARY) + if(TBB_USE_DEBUG_BUILD AND TBB_${_comp}_LIBRARY_DEBUG) + set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_DEBUG}") + elseif(TBB_${_comp}_LIBRARY_RELEASE) + set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_RELEASE}") + elseif(TBB_${_comp}_LIBRARY_DEBUG) + set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_DEBUG}") + message(STATUS "Using the debug library of '${_comp}' because the release library could not be found!") + endif() + endif() + + # Set the TBB library list and component found variables + if(TBB_${_comp}_LIBRARY) + list(APPEND TBB_LIBRARIES "${TBB_${_comp}_LIBRARY}") + set(TBB_${_comp}_FOUND TRUE) + else() + set(TBB_${_comp}_FOUND FALSE) + endif() + + mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE) + mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG) + mark_as_advanced(TBB_${_comp}_LIBRARY) + + endforeach() + + ################################## + # Set compile flags + ################################## + + if(TBB_tbb_LIBRARY MATCHES "debug") + set(TBB_DEFINITIONS "-DTBB_USE_DEBUG=1") + endif() + + ################################## + # Set version strings + ################################## + + if(TBB_INCLUDE_DIRS) + file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) + string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" + TBB_VERSION_MAJOR "${_tbb_version_file}") + string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" + TBB_VERSION_MINOR "${_tbb_version_file}") + string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" + TBB_INTERFACE_VERSION "${_tbb_version_file}") + set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}") + endif() + + find_package_handle_standard_args(TBB + REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES + HANDLE_COMPONENTS + VERSION_VAR TBB_VERSION) + + mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES) + + unset(TBB_ARCHITECTURE) + unset(TBB_LIB_PATH_SUFFIX) + unset(TBB_DEFAULT_SEARCH_DIR) + +endif() diff --git a/alpaka/doc/doxygen/Doxyfile b/alpaka/doc/doxygen/Doxyfile new file mode 100644 index 0000000000..1f7127b6a2 --- /dev/null +++ b/alpaka/doc/doxygen/Doxyfile @@ -0,0 +1,2501 @@ +# Doxyfile 1.8.13 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = alpaka + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Abstraction Library for Parallel Kernel Acceleration" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = alpaka_doxygen.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = YES + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = YES + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = YES + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = YES + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = YES + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../../include/ \ + ../../README.md + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.as \ + *.js \ + *.c \ + *.cu + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = ../../README.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 1 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /