diff --git a/.jenkins/cscs/env-gcc-cuda-11.sh b/.jenkins/cscs/env-gcc-cuda-11.sh index 562d51f30c..b68b79dbbc 100644 --- a/.jenkins/cscs/env-gcc-cuda-11.sh +++ b/.jenkins/cscs/env-gcc-cuda-11.sh @@ -4,17 +4,21 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -cxx_std="17" +cxx_std="20" +cuda_std="17" gcc_version="9.3.0" boost_version="1.75.0" hwloc_version="2.0.3" cuda_version="11.2.0" +fmt_version="9.1.0" spack_compiler="gcc@${gcc_version}" spack_arch="cray-cnl7-haswell" -spack_spec="pika@main arch=${spack_arch} %${spack_compiler} +cuda malloc=system cxxstd=${cxx_std} ^boost@${boost_version} ^hwloc@${hwloc_version} ^cuda@${cuda_version}" +spack_spec="pika@main arch=${spack_arch} %${spack_compiler} +cuda malloc=system cxxstd=${cxx_std} +^boost@${boost_version} ^hwloc@${hwloc_version} ^cuda@${cuda_version} ^fmt@${fmt_version}" configure_extra_options+=" -DPIKA_WITH_CXX_STANDARD=${cxx_std}" +configure_extra_options+=" -DCMAKE_CUDA_STANDARD=${cuda_std}" configure_extra_options+=" -DPIKA_WITH_MALLOC=system" configure_extra_options+=" -DPIKA_WITH_CUDA=ON" configure_extra_options+=" -DPIKA_WITH_EXAMPLES_OPENMP=ON" diff --git a/cmake/pika_setup_cuda.cmake b/cmake/pika_setup_cuda.cmake index 2a8b719aa8..e9701ccafa 100644 --- a/cmake/pika_setup_cuda.cmake +++ b/cmake/pika_setup_cuda.cmake @@ -28,14 +28,15 @@ if(PIKA_WITH_CUDA AND NOT TARGET pika_internal::cuda) # support if(NOT PIKA_FIND_PACKAGE) if(DEFINED CMAKE_CUDA_STANDARD AND NOT CMAKE_CUDA_STANDARD STREQUAL - PIKA_WITH_CXX_STANDARD + CMAKE_CXX_STANDARD ) - pika_error( - "You've set CMAKE_CUDA_STANDARD to ${CMAKE_CUDA_STANDARD} and PIKA_WITH_CXX_STANDARD to ${PIKA_WITH_CXX_STANDARD}. Please unset CMAKE_CUDA_STANDARD." + pika_info( + "You've set PIKA_WITH_CXX_STANDARD to ${PIKA_WITH_CXX_STANDARD} and CMAKE_CUDA_STANDARD to ${CMAKE_CUDA_STANDARD}." ) + else() + set(CMAKE_CUDA_STANDARD ${PIKA_WITH_CXX_STANDARD}) endif() - set(CMAKE_CUDA_STANDARD ${PIKA_WITH_CXX_STANDARD}) endif() set(CMAKE_CUDA_STANDARD_REQUIRED ON) @@ -62,10 +63,12 @@ if(PIKA_WITH_CUDA AND NOT TARGET pika_internal::cuda) pika_internal::cuda INTERFACE CUDA::cublas CUDA::cusolver ) endif() - # Flag not working for CLANG CUDA - target_compile_features( - pika_internal::cuda INTERFACE cuda_std_${PIKA_WITH_CXX_STANDARD} - ) + if (DEFINED CMAKE_CUDA_STANDARD) + # Flag not working for CLANG CUDA + target_compile_features( + pika_internal::cuda INTERFACE cuda_std_${CMAKE_CUDA_STANDARD} + ) + endif() set_target_properties( pika_internal::cuda PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON )