Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CUDA 10.2 #886

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ services:
# 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_VERSION : {8.0, 9.0, 9.1, 9.2, 10.0, 10.1, 10.2}
# [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}
Expand Down Expand Up @@ -318,6 +318,41 @@ matrix:
- 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

## CUDA 10.2
# nvcc + g++
- name: nvcc-10.2 + gcc-4.9 Release
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.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.71.0 ALPAKA_CI_CMAKE_VER=3.11.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;75"
- name: nvcc-10.2 + gcc-5 Debug
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.68.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;35"
- name: nvcc-10.2 + gcc-6 Release
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:14.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=6 CMAKE_BUILD_TYPE=Release 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.2 ALPAKA_CUDA_COMPILER=nvcc
- name: nvcc-10.2 + gcc-7 Debug
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=7 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=10.2 ALPAKA_CUDA_COMPILER=nvcc
- name: nvcc-10.2 + gcc-8 Release
env: ALPAKA_CI_DOCKER_BASE_IMAGE_NAME=ubuntu:18.04 CXX=g++ CC=gcc ALPAKA_CI_GCC_VER=8 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=10.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;35"
# nvcc + clang++
- name: nvcc-10.2 + clang-4 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.65.1 ALPAKA_CI_CMAKE_VER=3.15.2 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="30;60"
- name: nvcc-10.2 + clang-5 Debug
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.67.0 ALPAKA_CI_CMAKE_VER=3.13.5 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="75"
- name: nvcc-10.2 + clang-6 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=6.0.1 CMAKE_BUILD_TYPE=Release 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.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="70" ALPAKA_ACC_GPU_CUDA_ONLY_MODE=ON
- name: nvcc-10.2 + clang-7 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=libstdc++ ALPAKA_CI_BOOST_BRANCH=boost-1.70.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="75"
- name: nvcc-10.2 + clang-8 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.70.0 ALPAKA_CI_CMAKE_VER=3.12.4 ALPAKA_ACC_GPU_CUDA_ENABLE=ON ALPAKA_CUDA_VERSION=10.2 ALPAKA_CUDA_COMPILER=nvcc ALPAKA_CUDA_ARCH="75"
# nvcc + MSVC
- name: nvcc-10.2 + 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.2 ALPAKA_CUDA_ARCH="30;75" ALPAKA_ACC_GPU_CUDA_ONLY_MODE=ON
- name: nvcc-10.2 + 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.2 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

## 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.8.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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Accelerator Back-ends
| 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)|
|CUDA|CUDA 8.0-10.2|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)|


Expand All @@ -74,7 +74,7 @@ This library uses C++11 (or newer when available).
| 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: <br/> (CUDA 8.0-10.1)|:white_check_mark: <br/> (CUDA 9.0-10.1)|:white_check_mark: <br/> (CUDA 9.2-10.1) |:x:|:white_check_mark: <br/> (CUDA 9.1-10.1)|:white_check_mark: <br/> (CUDA 10.1)|:white_check_mark: <br/> (CUDA 10.1)|:white_check_mark: <br/> (CUDA 10.1)|:white_check_mark: <br/> (CUDA 10.1)|:x:|:x:|:white_check_mark: <br/> (CUDA 10.0-10.1)|
|CUDA (nvcc)|:white_check_mark: <br/> (CUDA 8.0-10.2)|:white_check_mark: <br/> (CUDA 9.0-10.2)|:white_check_mark: <br/> (CUDA 9.2-10.2) |:x:|:white_check_mark: <br/> (CUDA 9.1-10.2)|:white_check_mark: <br/> (CUDA 10.1-10.2)|:white_check_mark: <br/> (CUDA 10.1-10.2)|:white_check_mark: <br/> (CUDA 10.1-10.2)|:white_check_mark: <br/> (CUDA 10.1-10.2)|:x:|:x:|:white_check_mark: <br/> (CUDA 10.0-10.2)|
|CUDA (clang) | - | - | - | - | :white_check_mark: <br/> (CUDA 8.0)| :white_check_mark: <br/> (CUDA 8.0)| :white_check_mark: <br/> (CUDA 8.0-9.0) | :white_check_mark: <br/> (CUDA 8.0-9.2) | :white_check_mark: <br/> (CUDA 8.0-10.0) | :white_check_mark: <br/> (CUDA 9.2-10.1) | - | - |
|[HIP](doc/markdown/user/implementation/mapping/HIP.md) (nvcc)|:white_check_mark: <br/> (nvcc 9.0+)|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|:x:|

Expand Down
22 changes: 14 additions & 8 deletions alpakaConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ IF(ALPAKA_ACC_GPU_CUDA_ENABLE)
IF(CUDA_VERSION GREATER_EQUAL 10.1)
MESSAGE(FATAL_ERROR "Clang versions lower than 9 do not support CUDA 10.1 or greater!")
ENDIF()
ELSEIF(CMAKE_CXX_COMPILER_VERSION LESS 10.0)
BenjaminW3 marked this conversation as resolved.
Show resolved Hide resolved
IF(CUDA_VERSION GREATER_EQUAL 10.2)
MESSAGE(FATAL_ERROR "Clang versions lower than 10 do not support CUDA 10.2 or greater!")
BenjaminW3 marked this conversation as resolved.
Show resolved Hide resolved
ENDIF()
ENDIF()

IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE)
Expand Down Expand Up @@ -545,6 +549,10 @@ IF(ALPAKA_ACC_GPU_CUDA_ENABLE)
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()
ELSEIF(CUDA_VERSION VERSION_EQUAL 10.2)
IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 9.0)
MESSAGE(FATAL_ERROR "NVCC 10.2 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)
Expand All @@ -571,6 +579,10 @@ IF(ALPAKA_ACC_GPU_CUDA_ENABLE)
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()
ELSEIF(CUDA_VERSION VERSION_EQUAL 10.2)
IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 9.0)
MESSAGE(FATAL_ERROR "NVCC 10.2 does not support clang 9+. Please use clang 4, 5, 6, 7 or 8!")
ENDIF()
ENDIF()
ENDIF()

Expand Down Expand Up @@ -678,15 +690,9 @@ IF(ALPAKA_ACC_GPU_CUDA_ENABLE)
# avoids warnings on host-device signature of 'std::__shared_count<>'
IF(CUDA_VERSION EQUAL 10.0)
LIST(APPEND CUDA_NVCC_FLAGS -Xcudafe --diag_suppress=2905)
ENDIF()

# avoids warnings on host-device signature of 'std::__shared_count<>'
IF(CUDA_VERSION EQUAL 10.1)
ELSEIF(CUDA_VERSION EQUAL 10.1)
LIST(APPEND CUDA_NVCC_FLAGS -Xcudafe --diag_suppress=2912)
ENDIF()

# avoids warnings on host-device signature of 'std::__shared_count<>'
IF(CUDA_VERSION EQUAL 10.2)
ELSEIF(CUDA_VERSION EQUAL 10.2)
LIST(APPEND CUDA_NVCC_FLAGS -Xcudafe --diag_suppress=2976)
ENDIF()

Expand Down
13 changes: 11 additions & 2 deletions script/travis/install_cuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ then
ALPAKA_CUDA_PKG_DEB_NAME=cuda-repo-ubuntu1804-10-1-local
ALPAKA_CUDA_PKG_FILE_NAME="${ALPAKA_CUDA_PKG_DEB_NAME}"-10.1.168-418.67_1.0-1_amd64.deb
ALPAKA_CUDA_PKG_FILE_PATH=https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/${ALPAKA_CUDA_PKG_FILE_NAME}
elif [ "${ALPAKA_CUDA_VERSION}" == "10.2" ]
then
ALPAKA_CUDA_PKG_DEB_NAME=cuda-repo-ubuntu1804-10-2-local
ALPAKA_CUDA_PKG_FILE_NAME="${ALPAKA_CUDA_PKG_DEB_NAME}"-10.2.89-440.33.01_1.0-1_amd64.deb
ALPAKA_CUDA_PKG_FILE_PATH=http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/${ALPAKA_CUDA_PKG_FILE_NAME}
else
echo CUDA versions other than 8.0, 9.0, 9.1, 9.2, 10.0 and 10.1 are not currently supported on linux!
echo CUDA versions other than 8.0, 9.0, 9.1, 9.2, 10.0, 10.1 and 10.2 are not currently supported on linux!
fi
if [ -z "$(ls -A ${ALPAKA_CI_CUDA_DIR})" ]
then
Expand Down Expand Up @@ -96,8 +101,12 @@ then
then
ALPAKA_CUDA_PKG_FILE_NAME=cuda_10.1.168_425.25_win10.exe
ALPAKA_CUDA_PKG_FILE_PATH=https://developer.nvidia.com/compute/cuda/10.1/Prod/local_installers/${ALPAKA_CUDA_PKG_FILE_NAME}
elif [ "${ALPAKA_CUDA_VERSION}" == "10.2" ]
then
ALPAKA_CUDA_PKG_FILE_NAME=cuda_10.2.89_441.22_win10.exe
ALPAKA_CUDA_PKG_FILE_PATH=http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/${ALPAKA_CUDA_PKG_FILE_NAME}
else
echo CUDA versions other than 10.0 and 10.1 are not currently supported on Windows!
echo CUDA versions other than 10.0, 10.1 and 10.2 are not currently supported on Windows!
fi

curl -L -o cuda_installer.exe ${ALPAKA_CUDA_PKG_FILE_PATH}
Expand Down
9 changes: 7 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ SET_TARGET_PROPERTIES(
CatchMain
PROPERTIES FOLDER "test")

# NVCC does not incorporate the COMPILE_OPTIONS of a target but only the CMAKE_CXX_FLAGS
IF(ALPAKA_ACC_GPU_CUDA_ENABLE AND NOT ALPAKA_CUDA_COMPILER MATCHES "clang")
IF(ALPAKA_ACC_GPU_CUDA_ENABLE AND ALPAKA_CUDA_COMPILER MATCHES "nvcc")
# NVCC does not incorporate the COMPILE_OPTIONS of a target but only the CMAKE_CXX_FLAGS
GET_TARGET_PROPERTY(_COMMON_COMPILE_OPTIONS common COMPILE_OPTIONS)
# If the property does not exist, the variable is set to NOTFOUND.
IF(_COMMON_COMPILE_OPTIONS)
STRING(REPLACE ";" " " _COMMON_COMPILE_OPTIONS_STRING "${_COMMON_COMPILE_OPTIONS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_COMMON_COMPILE_OPTIONS_STRING}")
ENDIF()
# nvcc supports werror starting with 10.2
IF(CUDA_VERSION GREATER_EQUAL 10.2)
Copy link
Member

@ax3l ax3l Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this here is not ideal either, since for example package managers in unanticipated environments might run your tests and a simple warning will mark a package as broken.

Please just enable -Werror=all-warnings in CI, e.g. via a travis environment variable or additional CMake option of Alpaka (that is by default not on). Shipping auto-enabled -Werror flags of any kind in CMake scripts is a bug :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already did this for years with the normal compilers Werror flag as most other open source projects are also doing. So this is at least not regression.
Furthermore it is the exact goal of setting the Werror flag to let the tests fail if they do not compile cleanly. Why should we treat warnings differently to compile errors? Having no watnings is our definition of our tests passing. So if a package manager for any reason (I do not know why it should do this at all) runs the tests and they produce a warning on this platform, then our tests fail and this is exactly what we want. That's the whole goal behind Werror.

Copy link
Member

@ax3l ax3l Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just telling you from a package management point of view, that will use software with newer environments than what were available and testable at release, that this is not an ideal practice.

Package managers such as spack, homebrew, et al. run tests to see if a package is working in a larger environment (integration tests). One usually just runs what comes with the package, to avoid duplication and maintenance overhead.

As developers, we can recommend best practices but it is not our place to anticipate new additions to -Wall, -Wextra or whatever a compiler decides to warn on. There are more compilers and workflows out there than what we do daily, e.g. people that build their own compiler frontends, optimizer passes, tooling, etc. on projects such as ours. Maybe a new NVCC just warns on something totally minor. Let's not patronize them. Warnings are called warnings for a reason.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see your point. However a newer, self built or unknown compiler is in no way different to newer CUDA versions, newer or self built CMake versions, newer OSs or any other dependency. The Compiler is also only a dependency of alpaka. All of those dependencies can make the build or the tests fail at compile or runtime.
I do not see a reason why we should have lower requirements than is possible on the compilation while we expect everything to generate, run and calculate perfectly.
If we lower the requirements on one dependency, we should also reduce the requirements on numerical stability, quality of random numbers and other things that may behave unexpectedly on untested platforms.
Finding issues on untested platforms is the goal of tests and for alpaka a clean compilation is what we defined as a requirement for a successful test execution.

Copy link
Member

@ax3l ax3l Dec 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we lower the requirements on one dependency, we should also reduce the requirements on numerical stability, quality of random numbers and other things that may behave unexpectedly on untested platforms.

I think it's not that black and white. A compiler warning in a newer nvcc might just be fine, no reason to break the tests outside of CI for this. A test that passes and throws a warning is still a tests that passes its primary coded purpose. A CMake flag that also enables -Werror intentionally can then also be used on top of this.

This is just compartmentalization of goals into smaller scopes of interest. Our goal in mainline is to have the code base error and warning free. That's why we require -Werror for all code to come in. A user's primary downstream goal is to have the tests technically compute the right results as a baseline for whatever they want to do. They can decide if they want to treat warnings as errors as well. I tell you from experience that many use cases do not want this to be the case, because warnings are not errors, some warnings are false positives in new environments, etc. Let's just optionalize this and enable this for us.

MESSAGE("adding -Werror=all-warnings")
LIST(APPEND CUDA_NVCC_FLAGS -Werror=all-warnings)
ENDIF()
ENDIF()

LIST(APPEND _ALPAKA_TEST_OPTIONS "--use-colour yes")
Expand Down
2 changes: 0 additions & 2 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

CMAKE_MINIMUM_REQUIRED(VERSION 3.11.0)

PROJECT("alpakaUnitTest")

################################################################################
# Add subdirectories.
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion test/unit/queue/src/CollectiveQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
struct QueueCollectiveTestKernel
{
template<typename TAcc>
ALPAKA_FN_ACC auto operator()(
auto operator()(
sbastrakov marked this conversation as resolved.
Show resolved Hide resolved
TAcc const & acc,
int* resultsPtr) const
-> void
Expand Down