Skip to content

Commit

Permalink
Add support for CUDA 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminW3 committed Nov 30, 2019
1 parent 219d09d commit 3f5acf3
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 18 deletions.
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)
IF(CUDA_VERSION GREATER_EQUAL 10.2)
MESSAGE(FATAL_ERROR "Clang versions lower than 10 do not support CUDA 10.2 or greater!")
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)
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()(
TAcc const & acc,
int* resultsPtr) const
-> void
Expand Down

0 comments on commit 3f5acf3

Please sign in to comment.