From 36dd0d4f8133c5c75e4fbb5902da0a884658c234 Mon Sep 17 00:00:00 2001 From: Andrew Corrigan Date: Mon, 7 Mar 2022 23:49:47 -0500 Subject: [PATCH 01/30] Add support for C++20 --- RELEASE-NOTES.md | 4 ++++ cmake/SetupCompilerOptions.cmake | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 35edd4614..60d1d4e17 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -9,6 +9,10 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ## [Unreleased] - Release date yyyy-mm-dd +### Added +- Added support for C++20. Note: XL does not support C++20. + While PGI has C++20 support, it is currently disabled (A BLT fatal error will occur). + ## [Version 0.5.0] - Release date 2022-03-07 ### Added diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index 5fd3c1652..f2d3fb718 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -263,7 +263,7 @@ endif () SET( CMAKE_CXX_STANDARD_REQUIRED ON ) set(BLT_CXX_STD "" CACHE STRING "Version of C++ standard") -set_property(CACHE BLT_CXX_STD PROPERTY STRINGS c++98 c++11 c++14 c++17) +set_property(CACHE BLT_CXX_STD PROPERTY STRINGS c++98 c++11 c++14 c++17 c++20) if (BLT_CXX_STD) if( BLT_CXX_STD STREQUAL c++98 ) @@ -296,9 +296,22 @@ if (BLT_CXX_STD) FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT " " PGI "--c++17") + elseif( BLT_CXX_STD STREQUAL c++20) + # Error out on what does not support C++20 + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") + message(FATAL_ERROR "XL does not support C++20.") + endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") + message(FATAL_ERROR "PGI is not yet supported using C++20.") + endif() + if (ENABLE_CUDA AND (NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_20" IN_LIST CMAKE_CUDA_COMPILE_FEATURES))) + message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++20.") + endif() + + set(CMAKE_CXX_STANDARD 20) else() message(FATAL_ERROR "${BLT_CXX_STD} is an invalid entry for BLT_CXX_STD. " - "Valid Options are ( c++98, c++11, c++14, c++17 )") + "Valid Options are ( c++98, c++11, c++14, c++17, c++20 )") endif() if (ENABLE_CUDA) From 3e9deb42685018c325210394ed85001c78e374ab Mon Sep 17 00:00:00 2001 From: Alex Tyler Chapman Date: Fri, 11 Mar 2022 14:06:41 -0800 Subject: [PATCH 02/30] added build and config type to build output --- SetupBLT.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SetupBLT.cmake b/SetupBLT.cmake index 2a6db6610..79568ce4e 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -33,6 +33,8 @@ if (NOT BLT_LOADED) # Show CMake info right out of the gate ################################ message(STATUS "CMake Version: ${CMAKE_VERSION}") + message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}") + message(STATUS "CMake Configuration Types: ${CMAKE_CONFIGURATION_TYPE}") if(${CMAKE_VERSION} VERSION_LESS 3.8.0) message("*************************************") @@ -212,3 +214,13 @@ if (NOT BLT_LOADED) endif() endif() # only load BLT once! + + + + + + + + + + From 68cc57ca9d05d73467fa8a9c2758ad4703dc5982 Mon Sep 17 00:00:00 2001 From: Alex Tyler Chapman Date: Mon, 14 Mar 2022 12:40:10 -0700 Subject: [PATCH 03/30] removed newlines, print either build type or configuration types --- SetupBLT.cmake | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/SetupBLT.cmake b/SetupBLT.cmake index 79568ce4e..ab649a076 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -33,8 +33,16 @@ if (NOT BLT_LOADED) # Show CMake info right out of the gate ################################ message(STATUS "CMake Version: ${CMAKE_VERSION}") - message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}") - message(STATUS "CMake Configuration Types: ${CMAKE_CONFIGURATION_TYPE}") + if (DEFINED CMAKE_BUILD_TYPE) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "") + message(STATUS "CMake Build Type: ") + else() + message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}") + endif() + endif() + if (DEFINED CMAKE_CONFIGURATION_TYPES) + message(STATUS "CMake Configuration Types: ${CMAKE_CONFIGURATION_TYPES}") + endif() if(${CMAKE_VERSION} VERSION_LESS 3.8.0) message("*************************************") @@ -215,12 +223,3 @@ if (NOT BLT_LOADED) endif() # only load BLT once! - - - - - - - - - From 2b6835c2d8a89daa43d70fb47c9727632b67fa62 Mon Sep 17 00:00:00 2001 From: Alex Tyler Chapman Date: Mon, 14 Mar 2022 12:55:44 -0700 Subject: [PATCH 04/30] removed print --- SetupBLT.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/SetupBLT.cmake b/SetupBLT.cmake index ab649a076..f36de2b73 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -34,11 +34,7 @@ if (NOT BLT_LOADED) ################################ message(STATUS "CMake Version: ${CMAKE_VERSION}") if (DEFINED CMAKE_BUILD_TYPE) - if ("${CMAKE_BUILD_TYPE}" STREQUAL "") - message(STATUS "CMake Build Type: ") - else() - message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}") - endif() + message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}") endif() if (DEFINED CMAKE_CONFIGURATION_TYPES) message(STATUS "CMake Configuration Types: ${CMAKE_CONFIGURATION_TYPES}") From 8ef9e687c90c81756b58250b046bf3b03a8c46ba Mon Sep 17 00:00:00 2001 From: Brian Manh Hien Han Date: Mon, 14 Mar 2022 15:59:37 -0700 Subject: [PATCH 05/30] Update nevada configs --- ...lang_hip.cmake => cce@13.0.1_clang_hip.cmake} | 12 +++++++----- ...rocm@4.2.0_hip.cmake => rocm@4.5.2_hip.cmake} | 16 +++++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) rename host-configs/llnl/toss_4_x86_64_ib_cray/{cce@12.0.1_clang_hip.cmake => cce@13.0.1_clang_hip.cmake} (78%) rename host-configs/llnl/toss_4_x86_64_ib_cray/{rocm@4.2.0_hip.cmake => rocm@4.5.2_hip.cmake} (69%) diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@13.0.1_clang_hip.cmake similarity index 78% rename from host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake rename to host-configs/llnl/toss_4_x86_64_ib_cray/cce@13.0.1_clang_hip.cmake index 1266694a1..c640b6cbb 100644 --- a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.1_clang_hip.cmake +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@13.0.1_clang_hip.cmake @@ -12,10 +12,10 @@ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ -# HPE Cray cce@12.0.1 compilers +# HPE Cray cce@13.0.1 compilers #------------------------------------------------------------------------------ # _blt_tutorial_compiler_config_start -set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.1") +set(CCE_HOME "/usr/tce/packages/cce-tce/cce-13.0.1") set(CMAKE_C_COMPILER "${CCE_HOME}/bin/craycc" CACHE PATH "") set(CMAKE_CXX_COMPILER "${CCE_HOME}/bin/crayCC" CACHE PATH "") @@ -30,7 +30,7 @@ set(CMAKE_Fortran_COMPILER "${CCE_HOME}/bin/crayftn" CACHE PATH "") # _blt_tutorial_mpi_config_start set(ENABLE_MPI ON CACHE BOOL "") -set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.7-cce-12.0.1/") +set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.13-cce-13.0.1/") set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") @@ -44,9 +44,11 @@ set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") # _blt_tutorial_hip_config_start set(ENABLE_HIP ON CACHE BOOL "") -set(ROCM_PATH "/opt/rocm-4.2.0/" CACHE PATH "") -set(HIP_PLATFORM "clang" CACHE STRING "") +set(ROCM_PATH "/opt/rocm-4.5.2/" CACHE PATH "") set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") +# Recommended link line when not using tce-wrapped compilers +# set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags -L/opt/rocm-4.5.2/hip/lib -L/opt/rocm-4.5.2/lib -L/opt/rocm-4.5.2/lib64 -Wl,-rpath,/opt/rocm-4.5.2/hip/lib:/opt/rocm-4.5.2/lib:/opt/rocm-4.5.2/lib64 -lamdhip64 -lhsakmt -lhsa-runtime64 -lamd_comgr" CACHE STRING "") + # _blt_tutorial_hip_config_end diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.2.0_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.5.2_hip.cmake similarity index 69% rename from host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.2.0_hip.cmake rename to host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.5.2_hip.cmake index 3b330a46c..11a5b0978 100644 --- a/host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.2.0_hip.cmake +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/rocm@4.5.2_hip.cmake @@ -12,23 +12,22 @@ #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ -# ROCM@4.2.0 compilers +# ROCM@4.5.2 compilers #------------------------------------------------------------------------------ -set(ROCM_HOME "/usr/tce/packages/rocmcc-tce/rocmcc-4.2.0") +set(ROCM_HOME "/usr/tce/packages/rocmcc-tce/rocmcc-4.5.2-cce-13.0.1") set(CMAKE_C_COMPILER "${ROCM_HOME}/bin/amdclang" CACHE PATH "") set(CMAKE_CXX_COMPILER "${ROCM_HOME}/bin/hipcc" CACHE PATH "") # Fortran support -set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.1") set(ENABLE_FORTRAN ON CACHE BOOL "") -set(CMAKE_Fortran_COMPILER "${CCE_HOME}/bin/crayftn" CACHE PATH "") +set(CMAKE_Fortran_COMPILER "${ROCM_HOME}/bin/crayftn" CACHE PATH "") #------------------------------------------------------------------------------ # MPI Support #------------------------------------------------------------------------------ set(ENABLE_MPI ON CACHE BOOL "") -set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.7-rocmcc-4.2.0") +set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.13-rocmcc-4.5.2-cce-13.0.1") set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") @@ -37,5 +36,8 @@ set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") # HIP support #------------------------------------------------------------------------------ set(ENABLE_HIP ON CACHE BOOL "") -set(ROCM_PATH "/opt/rocm-4.2.0/" CACHE PATH "") -set(CMAKE_CUDA_ARCHITECTURES "gfx908" CACHE STRING "") +set(ROCM_PATH "/opt/rocm-4.5.2/" CACHE PATH "") +set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "") + +# Recommended link line when not using tce-wrapped compilers +# set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags -L/opt/rocm-4.5.2/hip/lib -L/opt/rocm-4.5.2/lib -L/opt/rocm-4.5.2/lib64 -Wl,-rpath,/opt/rocm-4.5.2/hip/lib:/opt/rocm-4.5.2/lib:/opt/rocm-4.5.2/lib64 -lamdhip64 -lhsakmt -lhsa-runtime64 -lamd_comgr" CACHE STRING "") From d058f6a1853f3cf05fb0cb704bcc1f4e991d257e Mon Sep 17 00:00:00 2001 From: Brian Han Date: Mon, 14 Mar 2022 16:19:35 -0700 Subject: [PATCH 06/30] Add corona config --- .../toss_4_x86_64_ib/rocm@4.5.2_hip.cmake | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 host-configs/llnl/toss_4_x86_64_ib/rocm@4.5.2_hip.cmake diff --git a/host-configs/llnl/toss_4_x86_64_ib/rocm@4.5.2_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib/rocm@4.5.2_hip.cmake new file mode 100644 index 000000000..8d17a68ee --- /dev/null +++ b/host-configs/llnl/toss_4_x86_64_ib/rocm@4.5.2_hip.cmake @@ -0,0 +1,43 @@ +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the corona cluster at LLNL +#------------------------------------------------------------------------------ +# This file provides CMake with paths / details for: +# C,C++, & Fortran compilers + MPI & HIP +# using ROCM compilers +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# ROCM@4.5.2 compilers +#------------------------------------------------------------------------------ +set(ROCM_HOME "/usr/tce/packages/rocmcc-tce/rocmcc-4.5.2") +set(CMAKE_C_COMPILER "${ROCM_HOME}/bin/amdclang" CACHE PATH "") +set(CMAKE_CXX_COMPILER "${ROCM_HOME}/bin/hipcc" CACHE PATH "") + +# Fortran support +set(ENABLE_FORTRAN ON CACHE BOOL "") +set(CMAKE_Fortran_COMPILER "${ROCM_HOME}/bin/amdflang" CACHE PATH "") + +#------------------------------------------------------------------------------ +# MPI Support +#------------------------------------------------------------------------------ +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPI_HOME "/usr/tce/packages/mvapich2-tce/mvapich2-2.3.6-rocmcc-4.5.2/") +set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") +set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") +set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") + +#------------------------------------------------------------------------------ +# HIP support +#------------------------------------------------------------------------------ +set(ENABLE_HIP ON CACHE BOOL "") +set(ROCM_PATH "/opt/rocm-4.5.2/" CACHE PATH "") +set(CMAKE_HIP_ARCHITECTURES "gfx906" CACHE STRING "") + +# Recommended link line when not using tce-wrapped compilers +# set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags -L/opt/rocm-4.5.2/hip/lib -L/opt/rocm-4.5.2/lib -L/opt/rocm-4.5.2/lib64 -Wl,-rpath,/opt/rocm-4.5.2/hip/lib:/opt/rocm-4.5.2/lib:/opt/rocm-4.5.2/lib64 -lamdhip64 -lhsakmt -lhsa-runtime64 -lamd_comgr" CACHE STRING "") From 4ef9b7fe44b987e3c7106e9a4eed5769550f9740 Mon Sep 17 00:00:00 2001 From: Brian Han Date: Tue, 15 Mar 2022 10:09:18 -0700 Subject: [PATCH 07/30] Add corona to gitlab CI --- .gitlab-ci.yml | 1 + .gitlab/build_corona.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .gitlab/build_corona.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0fd46d224..1b959a091 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,3 +35,4 @@ stages: include: - local: .gitlab/build_quartz.yml - local: .gitlab/build_lassen.yml + - local: .gitlab/build_corona.yml diff --git a/.gitlab/build_corona.yml b/.gitlab/build_corona.yml new file mode 100644 index 000000000..535c0e5aa --- /dev/null +++ b/.gitlab/build_corona.yml @@ -0,0 +1,50 @@ +#### +# This is the share configuration of jobs for corona +.on_corona: + tags: + - shell + - corona + rules: + - if: '$CI_COMMIT_BRANCH =~ /_qnone/ || $ON_CORONA == "OFF"' #run except if ... + when: never + - if: '$CI_JOB_NAME =~ /release_resources/' + when: always + - when: on_success + +#### +# In pre-build phase, allocate a node for builds +corona_allocate: + variables: + GIT_STRATEGY: none + extends: [.on_corona] + stage: allocate + script: + - salloc -p pbatch -N 1 -t 10 --no-shell --job-name=${PROJECT_ALLOC_NAME} --mpibind=off + needs: [] + +#### +# In post-build phase, deallocate resources +# Note : make sure this is run even on build phase failure +corona_release: + variables: + GIT_STRATEGY: none + extends: [.on_corona] + stage: release + script: + - export JOBID=$(squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A) + - if [[ -n "${JOBID}" ]]; then scancel ${JOBID}; fi + +#### +# Template +.build_on_corona: + stage: build + variables: + ALLOC_COMMAND: "srun -p pbatch -t 30 -N 1 ${ASSIGN_ID} --interactive" + extends: [.build_script, .on_corona] + +#### +# Build jobs +corona-rocm_4_5_2_hip: + variables: + HOST_CONFIG: "rocm@4.5.2_hip.cmake" + extends: [.build_on_corona] From 641729f73b0f4623c234b8c3b58116b1ef1b7637 Mon Sep 17 00:00:00 2001 From: Alan Dayton Date: Tue, 15 Mar 2022 17:33:51 -0700 Subject: [PATCH 08/30] Fix hardcoded standard for CUDA --- cmake/SetupCompilerOptions.cmake | 21 +++++++++++++-------- cmake/thirdparty/SetupCUDA.cmake | 4 ++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index f2d3fb718..ff12f4907 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -169,12 +169,13 @@ if (ENABLE_CUDA) if (BLT_CUDA_FLAGS) set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${BLT_CUDA_FLAGS}") endif() - # quirk of ordering means that one needs to define -std=c++11 in CMAKE_CUDA_FLAGS if - # --expt-extended-lambda is being used so cmake can get past the compiler check, - # but the CMAKE_CUDA_STANDARD stuff adds another definition in which breaks things. - # So we rip it out here, but it ends up being inserted in the final build rule by cmake. + # quirk of ordering means that one needs to define -std=c++ in + # CMAKE_CUDA_FLAGS if --expt-extended-lambda is being used so cmake can get past the + # compiler check, but the CMAKE_CUDA_STANDARD stuff adds another definition in which + # breaks things. So we rip it out here, but it ends up being inserted in the final + # build rule by cmake. if (CMAKE_CUDA_FLAGS) - STRING(REPLACE "-std=c++11" " " CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} ) + STRING(REPLACE "-std=c++${CMAKE_CUDA_STANDARD}" " " CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} ) endif() endif() @@ -314,11 +315,15 @@ if (BLT_CXX_STD) "Valid Options are ( c++98, c++11, c++14, c++17, c++20 )") endif() + message(STATUS "Standard C++${CMAKE_CXX_STANDARD} selected") + if (ENABLE_CUDA) - set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD}) - endif() + if (NOT DEFINED CMAKE_CUDA_STANDARD) + set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD}) + endif() - message(STATUS "Standard C++${CMAKE_CXX_STANDARD} selected") + message(STATUS "Standard C++${CMAKE_CUDA_STANDARD} selected for CUDA") + endif() endif() diff --git a/cmake/thirdparty/SetupCUDA.cmake b/cmake/thirdparty/SetupCUDA.cmake index 0c11219c8..d34858e9e 100644 --- a/cmake/thirdparty/SetupCUDA.cmake +++ b/cmake/thirdparty/SetupCUDA.cmake @@ -82,8 +82,8 @@ if (CUDA_LINK_WITH_NVCC) # executable link dependencies so the device link fails if there are any missing CUDA library dependencies. Since # we are doing a link with the nvcc compiler, the device link step is unnecessary . # Frustratingly, nvcc-link errors out if you pass it an empty file, so we have to first compile the empty file. - set(CMAKE_CUDA_DEVICE_LINK_LIBRARY "touch .cu ; ${CMAKE_CUDA_COMPILER} -std=c++11 -dc .cu -o ") - set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE "touch .cu ; ${CMAKE_CUDA_COMPILER} -std=c++11 -dc .cu -o ") + set(CMAKE_CUDA_DEVICE_LINK_LIBRARY "touch .cu ; ${CMAKE_CUDA_COMPILER} -std=c++${CMAKE_CUDA_STANDARD} -dc .cu -o ") + set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE "touch .cu ; ${CMAKE_CUDA_COMPILER} -std=c++${CMAKE_CUDA_STANDARD} -dc .cu -o ") endif() # If CUDA_TOOLKIT_ROOT_DIR is not set, it should be set by find_package(CUDA) From ecca08cc9a6c41142e99eb140bd9068abf10c4e4 Mon Sep 17 00:00:00 2001 From: Alex Tyler Chapman Date: Thu, 17 Mar 2022 15:00:03 -0700 Subject: [PATCH 09/30] checking global property instead --- SetupBLT.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SetupBLT.cmake b/SetupBLT.cmake index f36de2b73..8958349c8 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -33,12 +33,13 @@ if (NOT BLT_LOADED) # Show CMake info right out of the gate ################################ message(STATUS "CMake Version: ${CMAKE_VERSION}") - if (DEFINED CMAKE_BUILD_TYPE) - message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}") - endif() - if (DEFINED CMAKE_CONFIGURATION_TYPES) + get_property(_is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if (_is_multi_config) message(STATUS "CMake Configuration Types: ${CMAKE_CONFIGURATION_TYPES}") + else() + message(STATUS "CMake Build Type: ${CMAKE_BUILD_TYPE}") endif() + unset(_is_multi_config) if(${CMAKE_VERSION} VERSION_LESS 3.8.0) message("*************************************") From 37a61e9a3f6825fa5fcf33afb34815b665a9dde9 Mon Sep 17 00:00:00 2001 From: Chris White Date: Thu, 17 Mar 2022 16:49:37 -0700 Subject: [PATCH 10/30] make job names match, fix bash if to match toss3 and 4, quiet gitlab warning --- .gitlab-ci.yml | 2 +- .gitlab/build_corona.yml | 6 +++--- .gitlab/build_lassen.yml | 2 +- .gitlab/build_quartz.yml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b959a091..620d4da42 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ stages: .build_script: script: #Use pre-existing allocation if any - - JOBID=$(if [[ "$SYS_TYPE" == "toss_3_x86_64_ib" ]]; then squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A; fi) + - JOBID=$(if [[ $SYS_TYPE = toss_* ]]; then squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A; fi) - ASSIGN_ID=$(if [[ -n "${JOBID}" ]]; then echo "--jobid=${JOBID}"; fi) #BUILD + TEST - echo -e "section_start:$(date +%s):build_and_test\r\e[0K diff --git a/.gitlab/build_corona.yml b/.gitlab/build_corona.yml index 535c0e5aa..d38da6980 100644 --- a/.gitlab/build_corona.yml +++ b/.gitlab/build_corona.yml @@ -7,7 +7,7 @@ rules: - if: '$CI_COMMIT_BRANCH =~ /_qnone/ || $ON_CORONA == "OFF"' #run except if ... when: never - - if: '$CI_JOB_NAME =~ /release_resources/' + - if: '$CI_JOB_NAME =~ /corona_release/' when: always - when: on_success @@ -39,8 +39,8 @@ corona_release: .build_on_corona: stage: build variables: - ALLOC_COMMAND: "srun -p pbatch -t 30 -N 1 ${ASSIGN_ID} --interactive" - extends: [.build_script, .on_corona] + ALLOC_COMMAND: "srun -p pbatch -t 10 -N 1 ${ASSIGN_ID} --interactive" + extends: [.step_script, .on_corona] #### # Build jobs diff --git a/.gitlab/build_lassen.yml b/.gitlab/build_lassen.yml index f4c98271e..ad50839f3 100644 --- a/.gitlab/build_lassen.yml +++ b/.gitlab/build_lassen.yml @@ -23,7 +23,7 @@ stage: build variables: ALLOC_COMMAND: "lalloc 1 -W 10 -q pdebug" - extends: [.build_script, .on_lassen] + extends: [.step_script, .on_lassen] needs: [] #### diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index 6ba15e031..8b05c6a62 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -7,7 +7,7 @@ rules: - if: '$CI_COMMIT_BRANCH =~ /_qnone/ || $ON_QUARTZ == "OFF"' #run except if ... when: never - - if: '$CI_JOB_NAME =~ /release_resources/' + - if: '$CI_JOB_NAME =~ /quartz_release/' when: always - when: on_success @@ -39,8 +39,8 @@ quartz_release: .build_on_quartz: stage: build variables: - ALLOC_COMMAND: "srun -p pdebug -t 30 -N 1 ${ASSIGN_ID} --interactive" - extends: [.build_script, .on_quartz] + ALLOC_COMMAND: "srun -p pdebug -t 10 -N 1 ${ASSIGN_ID} --interactive" + extends: [.step_script, .on_quartz] #### # Build jobs From 135e0ef68ba309227d1cc1db8e2a958c4c161169 Mon Sep 17 00:00:00 2001 From: Chris White Date: Thu, 17 Mar 2022 16:52:29 -0700 Subject: [PATCH 11/30] revert attempt to quiet warning because the new tag isnt there --- .gitlab/build_corona.yml | 2 +- .gitlab/build_lassen.yml | 2 +- .gitlab/build_quartz.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab/build_corona.yml b/.gitlab/build_corona.yml index d38da6980..3e2b15084 100644 --- a/.gitlab/build_corona.yml +++ b/.gitlab/build_corona.yml @@ -40,7 +40,7 @@ corona_release: stage: build variables: ALLOC_COMMAND: "srun -p pbatch -t 10 -N 1 ${ASSIGN_ID} --interactive" - extends: [.step_script, .on_corona] + extends: [.build_script, .on_corona] #### # Build jobs diff --git a/.gitlab/build_lassen.yml b/.gitlab/build_lassen.yml index ad50839f3..f4c98271e 100644 --- a/.gitlab/build_lassen.yml +++ b/.gitlab/build_lassen.yml @@ -23,7 +23,7 @@ stage: build variables: ALLOC_COMMAND: "lalloc 1 -W 10 -q pdebug" - extends: [.step_script, .on_lassen] + extends: [.build_script, .on_lassen] needs: [] #### diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index 8b05c6a62..714d579ed 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -40,7 +40,7 @@ quartz_release: stage: build variables: ALLOC_COMMAND: "srun -p pdebug -t 10 -N 1 ${ASSIGN_ID} --interactive" - extends: [.step_script, .on_quartz] + extends: [.build_script, .on_quartz] #### # Build jobs From e5744e2c2debf049e029f14a4d77c596e5e296c6 Mon Sep 17 00:00:00 2001 From: Chris White Date: Thu, 17 Mar 2022 17:58:00 -0700 Subject: [PATCH 12/30] add needs to build template --- .gitlab/build_corona.yml | 1 + .gitlab/build_quartz.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitlab/build_corona.yml b/.gitlab/build_corona.yml index 3e2b15084..ee19a551a 100644 --- a/.gitlab/build_corona.yml +++ b/.gitlab/build_corona.yml @@ -41,6 +41,7 @@ corona_release: variables: ALLOC_COMMAND: "srun -p pbatch -t 10 -N 1 ${ASSIGN_ID} --interactive" extends: [.build_script, .on_corona] + needs: [corona_allocate] #### # Build jobs diff --git a/.gitlab/build_quartz.yml b/.gitlab/build_quartz.yml index 714d579ed..b9e49288f 100644 --- a/.gitlab/build_quartz.yml +++ b/.gitlab/build_quartz.yml @@ -41,6 +41,7 @@ quartz_release: variables: ALLOC_COMMAND: "srun -p pdebug -t 10 -N 1 ${ASSIGN_ID} --interactive" extends: [.build_script, .on_quartz] + needs: [quartz_allocate] #### # Build jobs From b13de78d7adb398259e7410d9afc06bb36018797 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 12:10:28 -0700 Subject: [PATCH 13/30] make output verbose --- .gitlab/build_and_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/build_and_test.sh b/.gitlab/build_and_test.sh index cd6130187..b65ed3c94 100755 --- a/.gitlab/build_and_test.sh +++ b/.gitlab/build_and_test.sh @@ -14,7 +14,7 @@ mkdir $BUILD_DIR cd $BUILD_DIR cmake -C ../host-configs/llnl/$SYS_TYPE/$HOST_CONFIG ../tests/internal -make -j8 +make VERBOSE=1 -j8 ctest -DCTEST_OUTPUT_ON_FAILURE=1 --no-compress-output -T Test -VV xsltproc -o junit.xml ../tests/ctest-to-junit.xsl Testing/*/Test.xml From ad8229d8daec37549e40dd462eeee765106c228f Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 13:17:01 -0700 Subject: [PATCH 14/30] remove logic that should be not required anymore --- cmake/SetupCompilerOptions.cmake | 37 ++++---------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index ff12f4907..37e313190 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -134,55 +134,26 @@ endif() # all targets that use -Compiler ########################################## -########################################## -# Support extra flags for the C compiler. -########################################## if(BLT_C_FLAGS) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${BLT_C_FLAGS}") message(STATUS "Updated CMAKE_C_FLAGS to \"${CMAKE_C_FLAGS}\"") endif() -############################################# -# Support extra flags for the C++ compiler. -############################################# if(BLT_CXX_FLAGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BLT_CXX_FLAGS}") message(STATUS "Updated CMAKE_CXX_FLAGS to \"${CMAKE_CXX_FLAGS}\"") endif() -################################################ -# Support extra flags for the Fortran compiler. -################################################ if(ENABLE_FORTRAN AND BLT_FORTRAN_FLAGS) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BLT_FORTRAN_FLAGS}") - message(STATUS "Updated CMAKE_Fortran_FLAGS to \"${CMAKE_Fortran_FLAGS}\"") + message(STATUS "Updated CMAKE_Fortran_FLAGS to \"${CMAKE_Fortran_FLAGS}\"") endif() - -############################################################ -# Map Legacy FindCUDA variables to native cmake variables -# Note - we are intentionally breaking the semicolon delimited -# list that FindCUDA demanded of CUDA_NVCC_FLAGS so users -# are forced to clean up their host configs. -############################################################ -if (ENABLE_CUDA) - if (BLT_CUDA_FLAGS) - set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${BLT_CUDA_FLAGS}") - endif() - # quirk of ordering means that one needs to define -std=c++ in - # CMAKE_CUDA_FLAGS if --expt-extended-lambda is being used so cmake can get past the - # compiler check, but the CMAKE_CUDA_STANDARD stuff adds another definition in which - # breaks things. So we rip it out here, but it ends up being inserted in the final - # build rule by cmake. - if (CMAKE_CUDA_FLAGS) - STRING(REPLACE "-std=c++${CMAKE_CUDA_STANDARD}" " " CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} ) - endif() +if (ENABLE_CUDA AND BLT_CUDA_FLAGS) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${BLT_CUDA_FLAGS}") + message(STATUS "Updated CMAKE_CUDA_FLAGS to \"${CMAKE_CUDA_FLAGS}\"") endif() - -################################################ -# Support extra linker flags -################################################ if(BLT_EXE_LINKER_FLAGS) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${BLT_EXE_LINKER_FLAGS}") message(STATUS "Updated CMAKE_EXE_LINKER_FLAGS to \"${CMAKE_EXE_LINKER_FLAGS}\"") From eb9f75055ac3e6d67c1003d965f1fd1bbd800afc Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 15:09:47 -0700 Subject: [PATCH 15/30] move compiler standards earlier --- SetupBLT.cmake | 6 ++- cmake/SetupCompilerOptions.cmake | 82 +++--------------------------- cmake/SetupCompilerStandards.cmake | 73 ++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 75 deletions(-) create mode 100644 cmake/SetupCompilerStandards.cmake diff --git a/SetupBLT.cmake b/SetupBLT.cmake index 8958349c8..be80c5a47 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -102,7 +102,6 @@ if (NOT BLT_LOADED) set_property(GLOBAL PROPERTY USE_FOLDERS ON) endif() - ################################ # Enable cmake compilation database feature ################################ @@ -113,6 +112,11 @@ if (NOT BLT_LOADED) ################################ include(${BLT_ROOT_DIR}/cmake/BLTMacros.cmake) + ################################ + # Setup compiler standards early + ################################ + include(${BLT_ROOT_DIR}/cmake/SetupCompilerStandards.cmake) + ################################ # Standard TPL support ################################ diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index 37e313190..cdee18b08 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -149,8 +149,14 @@ if(ENABLE_FORTRAN AND BLT_FORTRAN_FLAGS) message(STATUS "Updated CMAKE_Fortran_FLAGS to \"${CMAKE_Fortran_FLAGS}\"") endif() -if (ENABLE_CUDA AND BLT_CUDA_FLAGS) - set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${BLT_CUDA_FLAGS}") +if(ENABLE_CUDA) + if(BLT_CUDA_FLAGS) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${BLT_CUDA_FLAGS}") + message(STATUS "Updated CMAKE_CUDA_FLAGS to \"${CMAKE_CUDA_FLAGS}\"") + endif() + if(CMAKE_CUDA_FLAGS) + string(REPLACE "-std=c++${CMAKE_CUDA_STANDARD}" " " CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS}) + endif() message(STATUS "Updated CMAKE_CUDA_FLAGS to \"${CMAKE_CUDA_FLAGS}\"") endif() @@ -225,78 +231,6 @@ if(BUILD_SHARED_LIBS) endif() endif() -################################ -# C++ Standard -################################ -if (NOT DEFINED CMAKE_CXX_EXTENSIONS) - message(STATUS "Setting CMAKE_CXX_EXTENSIONS to Off") - set( CMAKE_CXX_EXTENSIONS OFF ) -endif () -SET( CMAKE_CXX_STANDARD_REQUIRED ON ) - -set(BLT_CXX_STD "" CACHE STRING "Version of C++ standard") -set_property(CACHE BLT_CXX_STD PROPERTY STRINGS c++98 c++11 c++14 c++17 c++20) - -if (BLT_CXX_STD) - if( BLT_CXX_STD STREQUAL c++98 ) - set(CMAKE_CXX_STANDARD 98) - elseif( BLT_CXX_STD STREQUAL c++11 ) - set(CMAKE_CXX_STANDARD 11) - blt_append_custom_compiler_flag( - FLAGS_VAR CMAKE_CXX_FLAGS - DEFAULT " " - XL "-std=c++11" - PGI "--c++11") - elseif( BLT_CXX_STD STREQUAL c++14) - set(CMAKE_CXX_STANDARD 14) - blt_append_custom_compiler_flag( - FLAGS_VAR CMAKE_CXX_FLAGS - DEFAULT " " - XL "-std=c++14" - PGI "--c++14") - elseif( BLT_CXX_STD STREQUAL c++17) - # Error out on what does not support C++17 - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") - message(FATAL_ERROR "XL does not support C++17.") - endif() - if (ENABLE_CUDA AND (NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_17" IN_LIST CMAKE_CUDA_COMPILE_FEATURES))) - message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++17.") - endif() - - set(CMAKE_CXX_STANDARD 17) - blt_append_custom_compiler_flag( - FLAGS_VAR CMAKE_CXX_FLAGS - DEFAULT " " - PGI "--c++17") - elseif( BLT_CXX_STD STREQUAL c++20) - # Error out on what does not support C++20 - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") - message(FATAL_ERROR "XL does not support C++20.") - endif() - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") - message(FATAL_ERROR "PGI is not yet supported using C++20.") - endif() - if (ENABLE_CUDA AND (NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_20" IN_LIST CMAKE_CUDA_COMPILE_FEATURES))) - message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++20.") - endif() - - set(CMAKE_CXX_STANDARD 20) - else() - message(FATAL_ERROR "${BLT_CXX_STD} is an invalid entry for BLT_CXX_STD. " - "Valid Options are ( c++98, c++11, c++14, c++17, c++20 )") - endif() - - message(STATUS "Standard C++${CMAKE_CXX_STANDARD} selected") - - if (ENABLE_CUDA) - if (NOT DEFINED CMAKE_CUDA_STANDARD) - set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD}) - endif() - - message(STATUS "Standard C++${CMAKE_CUDA_STANDARD} selected for CUDA") - endif() -endif() - ################################################################## # Additional compiler warnings and treatment of warnings as errors diff --git a/cmake/SetupCompilerStandards.cmake b/cmake/SetupCompilerStandards.cmake new file mode 100644 index 000000000..fedadc3de --- /dev/null +++ b/cmake/SetupCompilerStandards.cmake @@ -0,0 +1,73 @@ +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +if(NOT DEFINED CMAKE_CXX_EXTENSIONS) + message(STATUS "Setting CMAKE_CXX_EXTENSIONS to Off") + set(CMAKE_CXX_EXTENSIONS OFF) +endif() +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(BLT_CXX_STD "" CACHE STRING "Version of C++ standard") +set_property(CACHE BLT_CXX_STD PROPERTY STRINGS c++98 c++11 c++14 c++17 c++20) + +if (BLT_CXX_STD) + if( BLT_CXX_STD STREQUAL c++98 ) + set(CMAKE_CXX_STANDARD 98) + elseif( BLT_CXX_STD STREQUAL c++11 ) + set(CMAKE_CXX_STANDARD 11) + blt_append_custom_compiler_flag( + FLAGS_VAR CMAKE_CXX_FLAGS + DEFAULT " " + XL "-std=c++11" + PGI "--c++11") + elseif( BLT_CXX_STD STREQUAL c++14) + set(CMAKE_CXX_STANDARD 14) + blt_append_custom_compiler_flag( + FLAGS_VAR CMAKE_CXX_FLAGS + DEFAULT " " + XL "-std=c++14" + PGI "--c++14") + elseif( BLT_CXX_STD STREQUAL c++17) + # Error out on what does not support C++17 + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") + message(FATAL_ERROR "XL does not support C++17.") + endif() + if (ENABLE_CUDA AND (NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_17" IN_LIST CMAKE_CUDA_COMPILE_FEATURES))) + message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++17.") + endif() + + set(CMAKE_CXX_STANDARD 17) + blt_append_custom_compiler_flag( + FLAGS_VAR CMAKE_CXX_FLAGS + DEFAULT " " + PGI "--c++17") + elseif( BLT_CXX_STD STREQUAL c++20) + # Error out on what does not support C++20 + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") + message(FATAL_ERROR "XL does not support C++20.") + endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") + message(FATAL_ERROR "PGI is not yet supported using C++20.") + endif() + if (ENABLE_CUDA AND (NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_20" IN_LIST CMAKE_CUDA_COMPILE_FEATURES))) + message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++20.") + endif() + + set(CMAKE_CXX_STANDARD 20) + else() + message(FATAL_ERROR "${BLT_CXX_STD} is an invalid entry for BLT_CXX_STD. " + "Valid Options are ( c++98, c++11, c++14, c++17, c++20 )") + endif() + + message(STATUS "Standard C++${CMAKE_CXX_STANDARD} selected") + + if (ENABLE_CUDA) + if (NOT DEFINED CMAKE_CUDA_STANDARD) + set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD}) + endif() + + message(STATUS "Standard C++${CMAKE_CUDA_STANDARD} selected for CUDA") + endif() +endif() From 12494db92e1a2ac5a7b1ff0f3d6393a9b41e6fbf Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 15:21:37 -0700 Subject: [PATCH 16/30] re-remove logic that should not be needed --- cmake/SetupCompilerOptions.cmake | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index cdee18b08..180ce9f6b 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -149,14 +149,8 @@ if(ENABLE_FORTRAN AND BLT_FORTRAN_FLAGS) message(STATUS "Updated CMAKE_Fortran_FLAGS to \"${CMAKE_Fortran_FLAGS}\"") endif() -if(ENABLE_CUDA) - if(BLT_CUDA_FLAGS) - set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${BLT_CUDA_FLAGS}") - message(STATUS "Updated CMAKE_CUDA_FLAGS to \"${CMAKE_CUDA_FLAGS}\"") - endif() - if(CMAKE_CUDA_FLAGS) - string(REPLACE "-std=c++${CMAKE_CUDA_STANDARD}" " " CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS}) - endif() +if(ENABLE_CUDA AND BLT_CUDA_FLAGS) + set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${BLT_CUDA_FLAGS}") message(STATUS "Updated CMAKE_CUDA_FLAGS to \"${CMAKE_CUDA_FLAGS}\"") endif() From 9234c6b183cae4d682183ed8ad5ae9051884d797 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 15:23:28 -0700 Subject: [PATCH 17/30] make host-configs consistent in cuda versions --- .../blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake | 2 +- .../clang@upstream_nvcc_c++14-export-tpls.cmake | 2 +- .../llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake | 2 +- .../clang@upstream_nvcc_c++17_no_separable.cmake | 2 +- .../llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake | 2 +- host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake index 86f5dc0f3..2b7f91d90 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake @@ -58,7 +58,7 @@ set(BLT_OPENMP_LINK_FLAGS "-Xlinker -rpath -Xlinker ${OMP_HOME}/lib -L${OMP_HOME #------------------------------------------------------------------------------ set(ENABLE_CUDA ON CACHE BOOL "") -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-10.1.168" CACHE PATH "") +set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake index 310b9cbbf..8563e153c 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++14-export-tpls.cmake @@ -48,7 +48,7 @@ set(MPI_CXX_COMPILER "${_MPI_BASE_DIR}/bin/mpicxx" CACHE PATH "") set(ENABLE_CUDA ON CACHE BOOL "") -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.0.182" CACHE PATH "") +set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake index 4627f67f8..05e499e1e 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake @@ -48,7 +48,7 @@ set(MPI_CXX_COMPILER "${_MPI_BASE_DIR}/bin/mpicxx" CACHE PATH "") set(ENABLE_CUDA ON CACHE BOOL "") -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.0.182" CACHE PATH "") +set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake index b8f52a254..500ee8cb6 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake @@ -48,7 +48,7 @@ set(MPI_CXX_COMPILER "${_MPI_BASE_DIR}/bin/mpicxx" CACHE PATH "") set(ENABLE_CUDA ON CACHE BOOL "") -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.0.182" CACHE PATH "") +set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake index 55234cb47..877762404 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake @@ -63,7 +63,7 @@ set(BLT_FORTRAN_FLAGS "-WF,-C!" CACHE PATH "Converts C-style comments to Fortran #_blt_tutorial_useful_cuda_flags_start set(ENABLE_CUDA ON CACHE BOOL "") -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-10.1.168" CACHE PATH "") +set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER "${MPI_CXX_COMPILER}" CACHE PATH "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake index 7820ecb0b..5750e57fc 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake @@ -15,7 +15,7 @@ set(ENABLE_OPENMP OFF CACHE BOOL "") set(ENABLE_CUDA ON CACHE BOOL "") -set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-10.1.243" CACHE PATH "") +set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "") From 4cd693ff07f0fa5d1baff4668cba4473257f5492 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 15:25:50 -0700 Subject: [PATCH 18/30] remove unneeded std flags in cuda flags --- .../blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake | 2 +- .../llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake | 2 +- .../clang@upstream_nvcc_c++17_no_separable.cmake | 2 +- .../llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake index 2b7f91d90..8f6693e35 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake @@ -63,7 +63,7 @@ set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "") set (_cuda_arch "sm_70") -set (CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} -std=c++11 --expt-extended-lambda -G" CACHE STRING "" ) +set (CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} --expt-extended-lambda -G" CACHE STRING "" ) set (CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) set (CUDA_LINK_WITH_NVCC ON CACHE BOOL "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake index 05e499e1e..b29b15af8 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17.cmake @@ -55,7 +55,7 @@ set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "") set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") set(_cuda_arch "sm_${CMAKE_CUDA_ARCHITECTURES}") -set(CMAKE_CUDA_FLAGS "-Xcompiler=--gcc-toolchain=${_GCC_DIR} -restrict -arch ${_cuda_arch} -std=c++17 --expt-extended-lambda -G" CACHE STRING "") +set(CMAKE_CUDA_FLAGS "-Xcompiler=--gcc-toolchain=${_GCC_DIR} -restrict -arch ${_cuda_arch} --expt-extended-lambda -G" CACHE STRING "") set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake index 500ee8cb6..ccc031b5e 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_c++17_no_separable.cmake @@ -55,7 +55,7 @@ set(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH "") set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") set(_cuda_arch "sm_${CMAKE_CUDA_ARCHITECTURES}") -set(CMAKE_CUDA_FLAGS "-Xcompiler=--gcc-toolchain=${_GCC_DIR} -restrict -arch ${_cuda_arch} -std=c++17 --expt-extended-lambda -G" CACHE STRING "") +set(CMAKE_CUDA_FLAGS "-Xcompiler=--gcc-toolchain=${_GCC_DIR} -restrict -arch ${_cuda_arch} --expt-extended-lambda -G" CACHE STRING "") # nvcc does not like gtest's 'pthreads' flag set(gtest_disable_pthreads ON CACHE BOOL "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake index 877762404..90f78288f 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_nvcc_xlf.cmake @@ -69,7 +69,7 @@ set(CMAKE_CUDA_HOST_COMPILER "${MPI_CXX_COMPILER}" CACHE PATH "") set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") set(_cuda_arch "sm_${CMAKE_CUDA_ARCHITECTURES}") -set(CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} -std=c++11 --expt-extended-lambda -G" CACHE STRING "") +set(CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} --expt-extended-lambda -G" CACHE STRING "") set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) From 7e72e9e31bc27bd1afb090dcdd215f4fd89f7f12 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 15:36:13 -0700 Subject: [PATCH 19/30] use cmake cuda arch flag --- .../clang@upstream_link_with_nvcc.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake index 8f6693e35..be9a065d6 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake @@ -62,11 +62,12 @@ set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "") -set (_cuda_arch "sm_70") -set (CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} --expt-extended-lambda -G" CACHE STRING "" ) +set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "") +set(_cuda_arch "sm_${CMAKE_CUDA_ARCHITECTURES}") +set(CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} --expt-extended-lambda -G" CACHE STRING "" ) -set (CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) -set (CUDA_LINK_WITH_NVCC ON CACHE BOOL "") +set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) +set(CUDA_LINK_WITH_NVCC ON CACHE BOOL "") # nvcc does not like gtest's 'pthreads' flag set(gtest_disable_pthreads ON CACHE BOOL "") From 84b905fdb3439a29a81c328c9772bd871af31ae7 Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 15:49:17 -0700 Subject: [PATCH 20/30] move cuda language checks after enable cuda call --- cmake/SetupCompilerStandards.cmake | 8 -------- cmake/thirdparty/SetupCUDA.cmake | 11 +++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmake/SetupCompilerStandards.cmake b/cmake/SetupCompilerStandards.cmake index fedadc3de..91921785a 100644 --- a/cmake/SetupCompilerStandards.cmake +++ b/cmake/SetupCompilerStandards.cmake @@ -34,10 +34,6 @@ if (BLT_CXX_STD) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") message(FATAL_ERROR "XL does not support C++17.") endif() - if (ENABLE_CUDA AND (NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_17" IN_LIST CMAKE_CUDA_COMPILE_FEATURES))) - message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++17.") - endif() - set(CMAKE_CXX_STANDARD 17) blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS @@ -51,10 +47,6 @@ if (BLT_CXX_STD) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") message(FATAL_ERROR "PGI is not yet supported using C++20.") endif() - if (ENABLE_CUDA AND (NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_20" IN_LIST CMAKE_CUDA_COMPILE_FEATURES))) - message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++20.") - endif() - set(CMAKE_CXX_STANDARD 20) else() message(FATAL_ERROR "${BLT_CXX_STD} is an invalid entry for BLT_CXX_STD. " diff --git a/cmake/thirdparty/SetupCUDA.cmake b/cmake/thirdparty/SetupCUDA.cmake index d34858e9e..7dc73d224 100644 --- a/cmake/thirdparty/SetupCUDA.cmake +++ b/cmake/thirdparty/SetupCUDA.cmake @@ -67,6 +67,17 @@ if (NOT ENABLE_CLANG_CUDA) enable_language(CUDA) endif () +if(CMAKE_CUDA_STANDARD STREQUAL "17") + if(NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_17" IN_LIST CMAKE_CUDA_COMPILE_FEATURES)) + message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++17.") + endif() +endif() + +if(CMAKE_CUDA_STANDARD STREQUAL "20") + if(NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_20" IN_LIST CMAKE_CUDA_COMPILE_FEATURES)) + message(FATAL_ERROR "CMake's CUDA_STANDARD does not support C++20.") + endif() +endif() ############################################################ # Map Legacy FindCUDA variables to native cmake variables From 96d5a39640e0fecee1c321ab8039ca73a4d0cf0b Mon Sep 17 00:00:00 2001 From: Chris White Date: Fri, 18 Mar 2022 18:41:43 -0700 Subject: [PATCH 21/30] update release notes about cuda std flags --- RELEASE-NOTES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 60d1d4e17..c0f3ed278 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -13,6 +13,10 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ - Added support for C++20. Note: XL does not support C++20. While PGI has C++20 support, it is currently disabled (A BLT fatal error will occur). +### Fixed +- Removed hard-coded -std=c++11 from various places related to CUDA flags. This now honors + CMAKE_CUDA_STANDARD if set otherwise falls back on BLT_CXX_STD or CMAKE_CXX_STANDARD. + ## [Version 0.5.0] - Release date 2022-03-07 ### Added From b288a41573a1b3df3751a6bcaed364098230bcd5 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 22 Mar 2022 16:06:08 -0700 Subject: [PATCH 22/30] fix indexing, dont look at blame --- cmake/SetupCompilerStandards.cmake | 10 +++- .../cce@13.0.1_clang_hip_c++17.cmake | 49 +++++++++++++++++++ tests/internal/unit/CMakeLists.txt | 7 +-- 3 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 host-configs/llnl/toss_4_x86_64_ib_cray/cce@13.0.1_clang_hip_c++17.cmake diff --git a/cmake/SetupCompilerStandards.cmake b/cmake/SetupCompilerStandards.cmake index 91921785a..d8f70f3ac 100644 --- a/cmake/SetupCompilerStandards.cmake +++ b/cmake/SetupCompilerStandards.cmake @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (BSD-3-Clause) if(NOT DEFINED CMAKE_CXX_EXTENSIONS) - message(STATUS "Setting CMAKE_CXX_EXTENSIONS to Off") + message(STATUS "Setting CMAKE_CXX_EXTENSIONS to OFF") set(CMAKE_CXX_EXTENSIONS OFF) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -62,4 +62,12 @@ if (BLT_CXX_STD) message(STATUS "Standard C++${CMAKE_CUDA_STANDARD} selected for CUDA") endif() + + if (ENABLE_HIP AND ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21.0") + if (NOT DEFINED CMAKE_HIP_STANDARD) + set(CMAKE_HIP_STANDARD ${CMAKE_CXX_STANDARD}) + endif() + + message(STATUS "Standard C++${CMAKE_HIP_STANDARD} selected for HIP") + endif() endif() diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@13.0.1_clang_hip_c++17.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@13.0.1_clang_hip_c++17.cmake new file mode 100644 index 000000000..224fd5d1d --- /dev/null +++ b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@13.0.1_clang_hip_c++17.cmake @@ -0,0 +1,49 @@ +# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and +# other BLT Project Developers. See the top-level LICENSE file for details +# +# SPDX-License-Identifier: (BSD-3-Clause) + +#------------------------------------------------------------------------------ +# Example host-config file for the rznevada cluster at LLNL +#------------------------------------------------------------------------------ +# This file provides CMake with paths / details for: +# C,C++, & Fortran compilers + MPI & HIP +# using tce wrappers, rather than HPE Cray PE compiler drivers +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# HPE Cray cce@13.0.1 compilers +#------------------------------------------------------------------------------ +set(CCE_HOME "/usr/tce/packages/cce-tce/cce-13.0.1") +set(CMAKE_C_COMPILER "${CCE_HOME}/bin/craycc" CACHE PATH "") +set(CMAKE_CXX_COMPILER "${CCE_HOME}/bin/crayCC" CACHE PATH "") + +# Fortran support +set(ENABLE_FORTRAN ON CACHE BOOL "") +set(CMAKE_Fortran_COMPILER "${CCE_HOME}/bin/crayftn" CACHE PATH "") + +# Set compiler standard for C++ and HIP +set(BLT_CXX_STD "c++17" CACHE STRING "") + +#------------------------------------------------------------------------------ +# MPI Support +#------------------------------------------------------------------------------ +set(ENABLE_MPI ON CACHE BOOL "") + +set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.13-cce-13.0.1/") +set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") + +set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") + +set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") + +#------------------------------------------------------------------------------ +# HIP support +#------------------------------------------------------------------------------ +set(ENABLE_HIP ON CACHE BOOL "") + +set(ROCM_PATH "/opt/rocm-4.5.2/" CACHE PATH "") +set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") + +# Recommended link line when not using tce-wrapped compilers +# set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags -L/opt/rocm-4.5.2/hip/lib -L/opt/rocm-4.5.2/lib -L/opt/rocm-4.5.2/lib64 -Wl,-rpath,/opt/rocm-4.5.2/hip/lib:/opt/rocm-4.5.2/lib:/opt/rocm-4.5.2/lib64 -lamdhip64 -lhsakmt -lhsa-runtime64 -lamd_comgr" CACHE STRING "") diff --git a/tests/internal/unit/CMakeLists.txt b/tests/internal/unit/CMakeLists.txt index bd4f8b8c6..edcad9ae2 100644 --- a/tests/internal/unit/CMakeLists.txt +++ b/tests/internal/unit/CMakeLists.txt @@ -117,11 +117,12 @@ macro(compare_source_lists) list(SORT sorted_a_list) list(SORT sorted_b_list) - foreach(i RANGE ${a_len}) + math(EXPR _range_stop "${a_len} - 1") + foreach(i RANGE 0 ${_range_stop}) set(a_item) set(b_item) - list(GET sorted_a_list i a_item) - list(GET sorted_b_list i b_item) + list(GET sorted_a_list ${i} a_item) + list(GET sorted_b_list ${i} b_item) if(NOT a_item STREQUAL b_item) message(FATAL_ERROR "Split source test failed. ${a_item} != ${b_item}") From 88a9282e2f807b806e49ab80a392d50cb053fc4e Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 22 Mar 2022 17:12:03 -0700 Subject: [PATCH 23/30] quiet warning --- tests/smoke/blt_hip_gtest_smoke.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/smoke/blt_hip_gtest_smoke.cpp b/tests/smoke/blt_hip_gtest_smoke.cpp index d8ccb0435..76172e76c 100644 --- a/tests/smoke/blt_hip_gtest_smoke.cpp +++ b/tests/smoke/blt_hip_gtest_smoke.cpp @@ -30,6 +30,9 @@ TEST(blt_hip_gtest_smoke,basic_assert_example) int num_threads = STR_LENGTH; int num_blocks = 1; hipLaunchKernelGGL((hello), dim3(num_blocks), dim3(num_threads),0,0); - hipDeviceSynchronize(); + if(hipSuccess != hipDeviceSynchronize()) + { + std::cout << "ERROR: hipDeviceSynchronize failed!" << std::endl; + } EXPECT_TRUE( true ); } From fad27f50a233611bfb3c3ce738e9a1c1d3ed00e5 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 22 Mar 2022 17:13:57 -0700 Subject: [PATCH 24/30] add removal of generator expressions in the hip offload flag logic --- RELEASE-NOTES.md | 3 +++ cmake/thirdparty/SetupHIP.cmake | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c0f3ed278..d638dedc6 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -12,10 +12,13 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ### Added - Added support for C++20. Note: XL does not support C++20. While PGI has C++20 support, it is currently disabled (A BLT fatal error will occur). +- BLT_CXX_STD now sets CMAKE_HIP_STANDARD, in CMake 3.21+, similar to CMAKE_CUDA_STANDARD. ### Fixed - Removed hard-coded -std=c++11 from various places related to CUDA flags. This now honors CMAKE_CUDA_STANDARD if set otherwise falls back on BLT_CXX_STD or CMAKE_CXX_STANDARD. +- Removed extra HIP offload flags that were being added as generator expressions as opposed to simple + flags. ## [Version 0.5.0] - Release date 2022-03-07 diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index 6261febf1..f24ba376e 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -44,8 +44,15 @@ if(DEFINED AMDGPU_TARGETS) foreach(_target ${AMDGPU_TARGETS}) if (NOT "${CMAKE_HIP_ARCHITECTURES}" MATCHES "${_target}") - list(REMOVE_ITEM _hip_compile_options "--offload-arch=${_target}") - list(REMOVE_ITEM _hip_link_libs "--offload-arch=${_target}") + set(_flag "--offload-arch=${_target}") + set(_generator_compile_flag "$<$:SHELL:${_flag}>") + set(_generator_link_flag "$<$:${_flag}>") + + # Remove generator expressions first because they are a superset + list(REMOVE_ITEM _hip_compile_options ${_generator_compile_flag}) + list(REMOVE_ITEM _hip_compile_options ${_flag}) + list(REMOVE_ITEM _hip_link_libs ${_generator_link_flag}) + list(REMOVE_ITEM _hip_link_libs ${_flag}) endif() endforeach() From 67b9410481579248005247c44dca8c82c02e40da Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 22 Mar 2022 17:18:06 -0700 Subject: [PATCH 25/30] remove comment that made no sense in retrospect --- cmake/thirdparty/SetupHIP.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/thirdparty/SetupHIP.cmake b/cmake/thirdparty/SetupHIP.cmake index f24ba376e..152342047 100644 --- a/cmake/thirdparty/SetupHIP.cmake +++ b/cmake/thirdparty/SetupHIP.cmake @@ -48,7 +48,6 @@ if(DEFINED AMDGPU_TARGETS) set(_generator_compile_flag "$<$:SHELL:${_flag}>") set(_generator_link_flag "$<$:${_flag}>") - # Remove generator expressions first because they are a superset list(REMOVE_ITEM _hip_compile_options ${_generator_compile_flag}) list(REMOVE_ITEM _hip_compile_options ${_flag}) list(REMOVE_ITEM _hip_link_libs ${_generator_link_flag}) From d4f66e9c60d55ab03479534681f60f5e1b475902 Mon Sep 17 00:00:00 2001 From: Chris White Date: Tue, 22 Mar 2022 17:38:05 -0700 Subject: [PATCH 26/30] quiet more warnings --- tests/smoke/blt_hip_runtime_smoke.cpp | 11 +++++++++-- tests/smoke/blt_hip_smoke.cpp | 5 ++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/smoke/blt_hip_runtime_smoke.cpp b/tests/smoke/blt_hip_runtime_smoke.cpp index 65a1e771a..a7ca79fc6 100644 --- a/tests/smoke/blt_hip_runtime_smoke.cpp +++ b/tests/smoke/blt_hip_runtime_smoke.cpp @@ -17,11 +17,18 @@ int main() { int nDevices; - hipGetDeviceCount(&nDevices); + if(hipSuccess != hipGetDeviceCount(&nDevices)) + { + std::cout << "ERROR: hipGetDeviceCount failed!" << std::endl; + } + for (int i = 0; i < nDevices; i++) { hipDeviceProp_t prop; - hipGetDeviceProperties(&prop, i); + if(hipSuccess != hipGetDeviceProperties(&prop, i)) + { + std::cout << "ERROR: hipGetDeviceProperties failed!" << std::endl; + } printf("Device Number: %d\n", i); printf(" Device name: %s\n", prop.name); printf(" Memory Clock Rate (KHz): %d\n", diff --git a/tests/smoke/blt_hip_smoke.cpp b/tests/smoke/blt_hip_smoke.cpp index 3a0cd7f2c..b94eb152b 100644 --- a/tests/smoke/blt_hip_smoke.cpp +++ b/tests/smoke/blt_hip_smoke.cpp @@ -26,7 +26,10 @@ int main() int num_threads = STR_LENGTH; int num_blocks = 1; hipLaunchKernelGGL((hello), dim3(num_blocks), dim3(num_threads),0,0); - hipDeviceSynchronize(); + if(hipSuccess != hipDeviceSynchronize()) + { + std::cout << "ERROR: hipDeviceSynchronize failed!" << std::endl; + } return 0; } From 9e1739acac02780e32b32efcc37b8ac8dc907728 Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 23 Mar 2022 14:30:30 -0700 Subject: [PATCH 27/30] remove host-config to compiler that doesnt seem to work --- .../cce@12.0.3_clang_hip.cmake | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake diff --git a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake b/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake deleted file mode 100644 index 7d26ee4e0..000000000 --- a/host-configs/llnl/toss_4_x86_64_ib_cray/cce@12.0.3_clang_hip.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and -# other BLT Project Developers. See the top-level LICENSE file for details -# -# SPDX-License-Identifier: (BSD-3-Clause) - -#------------------------------------------------------------------------------ -# Example host-config file for the rzwhamo cluster at LLNL -#------------------------------------------------------------------------------ -# This file provides CMake with paths / details for: -# C,C++, & Fortran compilers + MPI & HIP -# using tce wrappers, rather than HPE Cray PE compiler drivers -#------------------------------------------------------------------------------ - -#------------------------------------------------------------------------------ -# HPE Cray cce@12.0.3 compilers -#------------------------------------------------------------------------------ -set(CCE_HOME "/usr/tce/packages/cce-tce/cce-12.0.3") -set(CMAKE_C_COMPILER "${CCE_HOME}/bin/craycc" CACHE PATH "") -set(CMAKE_CXX_COMPILER "${CCE_HOME}/bin/crayCC" CACHE PATH "") - -# Fortran support -set(ENABLE_FORTRAN ON CACHE BOOL "") -set(CMAKE_Fortran_COMPILER "${CCE_HOME}/bin/crayftn" CACHE PATH "") - -#------------------------------------------------------------------------------ -# MPI Support -#------------------------------------------------------------------------------ -set(ENABLE_MPI ON CACHE BOOL "") - -set(MPI_HOME "/usr/tce/packages/cray-mpich-tce/cray-mpich-8.1.8-cce-12.0.3/") -set(MPI_C_COMPILER "${MPI_HOME}/bin/mpicc" CACHE PATH "") - -set(MPI_CXX_COMPILER "${MPI_HOME}/bin/mpicxx" CACHE PATH "") - -set(MPI_Fortran_COMPILER "${MPI_HOME}/bin/mpif90" CACHE PATH "") - -#------------------------------------------------------------------------------ -# HIP support -#------------------------------------------------------------------------------ -set(ENABLE_HIP ON CACHE BOOL "") - -set(ROCM_PATH "/opt/rocm-4.5.0/" CACHE PATH "") -set(HIP_PLATFORM "clang" CACHE STRING "") -set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") From ea47a88c5dbf89c7fd6eefb6cfd9076df7bb1b0a Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 23 Mar 2022 14:48:51 -0700 Subject: [PATCH 28/30] remove deprecated hcc functionality --- RELEASE-NOTES.md | 3 + cmake/BLTMacros.cmake | 3 +- cmake/BLTOptions.cmake | 1 - cmake/SetupCompilerOptions.cmake | 2 - cmake/thirdparty/FindROCm.cmake | 27 --------- cmake/thirdparty/SetupHCC.cmake | 39 ------------- cmake/thirdparty/SetupThirdParty.cmake | 8 --- docs/api/utility.rst | 1 - docs/tutorial/portable_compiler_flags.rst | 1 - host-configs/other/hcc.cmake | 71 ----------------------- tests/internal/CMakeLists.txt | 2 - tests/smoke/CMakeLists.txt | 24 -------- tests/smoke/blt_hcc_runtime_smoke.cpp | 47 --------------- tests/smoke/blt_hcc_smoke.cpp | 29 --------- 14 files changed, 4 insertions(+), 254 deletions(-) delete mode 100644 cmake/thirdparty/FindROCm.cmake delete mode 100644 cmake/thirdparty/SetupHCC.cmake delete mode 100644 host-configs/other/hcc.cmake delete mode 100644 tests/smoke/blt_hcc_runtime_smoke.cpp delete mode 100644 tests/smoke/blt_hcc_smoke.cpp diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index d638dedc6..c47fdde1e 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -42,6 +42,9 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ for more user customization and to improve handling of file names with multiple periods, e.g. `1d.cube.order2.c` is considered a `.c` file. +### Removed +- Removed support for deprecated HCC. + ## [Version 0.4.1] - Release date 2021-07-20 ### Added diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index 722e3e439..6d5d78547 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -958,7 +958,6 @@ endmacro(blt_add_benchmark) ## DEFAULT defaultFlag (optional) ## GNU gnuFlag (optional) ## CLANG clangFlag (optional) -## HCC hccFlag (optional) ## INTEL intelFlag (optional) ## INTELLLVM intelLLVMFlag (optional) ## XL xlFlag (optional) @@ -972,7 +971,7 @@ endmacro(blt_add_benchmark) macro(blt_append_custom_compiler_flag) set(options) - set(singleValueArgs FLAGS_VAR DEFAULT GNU CLANG HCC PGI INTEL INTELLLVM XL MSVC MSVC_INTEL CRAY) + set(singleValueArgs FLAGS_VAR DEFAULT GNU CLANG PGI INTEL INTELLLVM XL MSVC MSVC_INTEL CRAY) set(multiValueArgs) # Parse the arguments diff --git a/cmake/BLTOptions.cmake b/cmake/BLTOptions.cmake index 564c06590..ec4594537 100644 --- a/cmake/BLTOptions.cmake +++ b/cmake/BLTOptions.cmake @@ -59,7 +59,6 @@ mark_as_advanced(ENABLE_CLANG_CUDA) set(BLT_CLANG_CUDA_ARCH "sm_30" CACHE STRING "Compute architecture to use when generating CUDA code with Clang") mark_as_advanced(BLT_CLANG_CUDA_ARCH) option(ENABLE_HIP "Enable HIP support" OFF) -option(ENABLE_HCC "Enable HCC support" OFF) set(CMAKE_HIP_ARCHITECTURES "gfx900" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") #------------------------------------------------------------------------------ diff --git a/cmake/SetupCompilerOptions.cmake b/cmake/SetupCompilerOptions.cmake index 180ce9f6b..2af48cd8d 100644 --- a/cmake/SetupCompilerOptions.cmake +++ b/cmake/SetupCompilerOptions.cmake @@ -236,7 +236,6 @@ blt_append_custom_compiler_flag( CLANG "-Wall -Wextra" # Additional possibilities for clang include: # "-Wdocumentation -Wdeprecated -Weverything" - HCC "-Wall" PGI "-Minform=warn" MSVC "/W4" # Additional possibilities for visual studio include: @@ -253,7 +252,6 @@ blt_append_custom_compiler_flag( CLANG "-Wall -Wextra" # Additional possibilities for clang include: # "-Wdocumentation -Wdeprecated -Weverything" - HCC "-Wall" PGI "-Minform=warn" MSVC "/W4" # Additional possibilities for visual studio include: diff --git a/cmake/thirdparty/FindROCm.cmake b/cmake/thirdparty/FindROCm.cmake deleted file mode 100644 index 2ca58d954..000000000 --- a/cmake/thirdparty/FindROCm.cmake +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and -# other BLT Project Developers. See the top-level LICENSE file for details -# -# SPDX-License-Identifier: (BSD-3-Clause) - -# Author: Chip Freitag @ Advanced Micro Devices, Inc. -# Date: February 14, 2018 - -find_path(ROCM_PATH - NAMES bin/hcc - PATHS - ENV ROCM_DIR - ${ROCM_ROOT_DIR} - /opt/rocm - DOC "Path to ROCm hcc executable") - - -if(ROCM_PATH) - message(STATUS "ROCM_PATH: ${ROCM_PATH}") - set(CMAKE_CXX_COMPILER_ID "HCC") - - set(ROCM_FOUND TRUE) - -else() - set(ROCM_FOUND FALSE) - message(WARNING "ROCm hcc executable not found") -endif() diff --git a/cmake/thirdparty/SetupHCC.cmake b/cmake/thirdparty/SetupHCC.cmake deleted file mode 100644 index 4897bbe64..000000000 --- a/cmake/thirdparty/SetupHCC.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and -# other BLT Project Developers. See the top-level LICENSE file for details -# -# SPDX-License-Identifier: (BSD-3-Clause) - -################################ -# ROCM -################################ - -if (ENABLE_HCC) - set (CMAKE_MODULE_PATH "${BLT_ROOT_DIR}/cmake/thirdparty;${CMAKE_MODULE_PATH}") - find_package(ROCm REQUIRED) - - if (ROCM_FOUND) - message(STATUS "ROCM Compile Flags: ${ROCM_CXX_COMPILE_FLAGS}") - message(STATUS "ROCM Include Path: ${ROCM_INCLUDE_PATH}") - message(STATUS "ROCM Link Flags: ${ROCM_CXX_LINK_FLAGS}") - message(STATUS "ROCM Libraries: ${ROCM_CXX_LIBRARIES}") - message(STATUS "ROCM Device Arch: ${ROCM_ARCH}") - - if (ENABLE_FORTRAN) - message(ERROR "ROCM does not support Fortran at this time") - endif() - else() - message(ERROR "ROCM Executable not found") - endif() -endif() - - - -# register ROCM with blt -blt_register_library(NAME rocm - INCLUDES ${ROCM_CXX_INCLUDE_PATH} - LIBRARIES ${ROCM_CXX_LIBRARIES} - COMPILE_FLAGS ${ROCM_CXX_COMPILE_FLAGS} - LINK_FLAGS ${ROCM_CXX_LINK_FLAGS} - DEFINES USE_ROCM) - - diff --git a/cmake/thirdparty/SetupThirdParty.cmake b/cmake/thirdparty/SetupThirdParty.cmake index 38c09ab1f..c8e6e27ed 100644 --- a/cmake/thirdparty/SetupThirdParty.cmake +++ b/cmake/thirdparty/SetupThirdParty.cmake @@ -56,14 +56,6 @@ if (ENABLE_HIP) include(${BLT_ROOT_DIR}/cmake/thirdparty/SetupHIP.cmake) endif() -#------------------------------------ -# HCC -#------------------------------------ -message(STATUS "HCC Support is ${ENABLE_HCC}") -if (ENABLE_HCC) - include(${BLT_ROOT_DIR}/cmake/thirdparty/SetupHCC.cmake) -endif() - #------------------------------------ # Documentation Packages diff --git a/docs/api/utility.rst b/docs/api/utility.rst index 72b048d4d..85753f2cf 100644 --- a/docs/api/utility.rst +++ b/docs/api/utility.rst @@ -55,7 +55,6 @@ blt_append_custom_compiler_flag DEFAULT defaultFlag (optional) GNU gnuFlag (optional) CLANG clangFlag (optional) - HCC hccFlag (optional) INTEL intelFlag (optional) INTELLLVM intelLLVMFlag (optional) XL xlFlag (optional) diff --git a/docs/tutorial/portable_compiler_flags.rst b/docs/tutorial/portable_compiler_flags.rst index 5ac671553..be3fc641a 100644 --- a/docs/tutorial/portable_compiler_flags.rst +++ b/docs/tutorial/portable_compiler_flags.rst @@ -27,7 +27,6 @@ which allows users to easily place a compiler dependent flag into a CMake variab * MSVC (Microsoft Visual Studio) * MSVC_INTEL (Intel toolchain in Microsoft Visual Studio) * PGI - * HCC (AMD GPU) Here is an example for setting the appropriate flag to treat warnings as errors: diff --git a/host-configs/other/hcc.cmake b/host-configs/other/hcc.cmake deleted file mode 100644 index c3e2f564d..000000000 --- a/host-configs/other/hcc.cmake +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and -# other BLT Project Developers. See the top-level LICENSE file for details -# -# SPDX-License-Identifier: (BSD-3-Clause) - -# The CMake command line to use this host config file must have certain -# defines enabled. Here is an example script for an out-of-place build of the -# tutorial blank project template: -## hcc.sh -##!/bin/bash -#rm -rf build-hcc-release 2>/dev/null -#mkdir build-hcc-release && cd build-hcc-release - -#BLT_DIR=$(git rev-parse --show-toplevel) - -#cmake \ -# -DCMAKE_BUILD_TYPE=Release \ -# -DENABLE_HCC=ON -DBLT_SOURCE_DIR=${BLT_DIR} \ -# -DROCM_ARCH=gfx900 \ -# -C ${BLT_DIR}/host-configs/hcc.cmake \ -# -DCMAKE_INSTALL_PREFIX=../install-hcc-release \ -# "$@" \ -# ${BLT_DIR}/docs/tutorial/blank_project - - -########################################################### -# standard ROCm HCC compiler -########################################################### - -set(ENABLE_HCC ON CACHE BOOL "") -set(ENABLE_OPENMP OFF CACHE BOOL "") - -set(ROCM_ROOT_DIR "/opt/rocm" CACHE PATH "ROCm ROOT directory path") - -if ( IS_DIRECTORY "${ROCM_ROOT_DIR}/hcc/include" ) # this path only exists on older rocm installs - set(ROCM_INCLUDE_PATH "${ROCM_ROOT_DIR}/hcc/include;${ROCM_ROOT_DIR}/include" CACHE PATH "") -else() - set(ROCM_INCLUDE_PATH "${ROCM_ROOT_DIR}/include" CACHE PATH "") -endif() -set(ROCM_CXX_LIBRARIES "-L${ROCM_ROOT_DIR}/lib -lhc_am -lhip_hcc" CACHE STRING "") - -########################################################### -# specify the target architecture -# Default with ROCm 1.7 is gfx803 (Fiji) -# Other options: -# gfx700 Hawaii -# gfx803 Polaris (RX580) -# gfx900 Vega -# gfx901 -########################################################### -set(ROCM_ARCH_FLAG "-amdgpu-target=${ROCM_ARCH}" CACHE STRING "") - -########################################################### -# get compile/link flags from hcc-config -########################################################### -# execute_process(COMMAND ${ROCM_ROOT_DIR}/hcc/bin/hcc-config --cxxflags OUTPUT_VARIABLE ROCM_CXX_COMPILE_FLAGS) -# execute_process(COMMAND ${ROCM_ROOT_DIR}/hcc/bin/hcc-config --ldflags OUTPUT_VARIABLE ROCM_CXX_LINK_FLAGS) -set(ROCM_CXX_COMPILE_FLAGS "-hc;-std=c++amp") -set(ROCM_CXX_LINK_FLAGS "-hc -std=c++amp") - -set(ROCM_CXX_COMPILE_FLAGS "${ROCM_CXX_COMPILE_FLAGS};-Wno-unused-parameter;-DHCC_ENABLE_ACCELERATOR_PRINTF" CACHE STRING "") -set(ROCM_CXX_LINK_FLAGS "${ROCM_CXX_LINK_FLAGS} ${ROCM_ARCH_FLAG} ${ROCM_CXX_LIBRARIES}" CACHE STRING "") - -########################################################### -# set CMake cache variables -########################################################### -# if hcc does not exist, consider setting the compiler to "${ROCM_ROOT_DIR}/bin/hipcc" -set(CMAKE_CXX_COMPILER "${ROCM_ROOT_DIR}/hcc/bin/hcc" CACHE FILEPATH "ROCm HCC compiler") -# set(BLT_CXX_FLAGS "${ROCM_CXX_COMPILE_FLAGS}" CACHE STRING "HCC compiler flags") - -set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_COMPILER} ${ROCM_CXX_LINK_FLAGS} -o " CACHE STRING "HCC linker command line") diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index e69e0792b..3bcacf7d2 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -285,8 +285,6 @@ if(CLANGFORMAT_FOUND) ../smoke/blt_gbenchmark_smoke.cpp ../smoke/blt_gmock_smoke.cpp ../smoke/blt_gtest_smoke.cpp - ../smoke/blt_hcc_runtime_smoke.cpp - ../smoke/blt_hcc_smoke.cpp ../smoke/blt_hip_runtime_smoke.cpp ../smoke/blt_hip_gtest_smoke.cpp ../smoke/blt_hip_smoke.cpp diff --git a/tests/smoke/CMakeLists.txt b/tests/smoke/CMakeLists.txt index 265f06976..266461591 100644 --- a/tests/smoke/CMakeLists.txt +++ b/tests/smoke/CMakeLists.txt @@ -185,30 +185,6 @@ if (ENABLE_CUDA) endif() endif() -################ -# HCC test -################ -if (ENABLE_HCC) - blt_add_executable(NAME blt_hcc_smoke - SOURCES blt_hcc_smoke.cpp - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON rocm - FOLDER blt/tests ) - - blt_add_test(NAME blt_hcc_smoke - COMMAND blt_hcc_smoke) - - blt_add_executable(NAME blt_hcc_runtime_smoke - SOURCES blt_hcc_runtime_smoke.cpp - OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON rocm - FOLDER blt/tests ) - - blt_add_test(NAME blt_hcc_runtime_smoke - COMMAND blt_hcc_runtime_smoke) - - -endif() ################ # HIP test diff --git a/tests/smoke/blt_hcc_runtime_smoke.cpp b/tests/smoke/blt_hcc_runtime_smoke.cpp deleted file mode 100644 index f9eea6e1f..000000000 --- a/tests/smoke/blt_hcc_runtime_smoke.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and -// other BLT Project Developers. See the top-level LICENSE file for details -// -// SPDX-License-Identifier: (BSD-3-Clause) - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// -// Note: This is a ROCm example from AMD: -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - -//----------------------------------------------------------------------------- -// -// file: blt_hcc_runtime_smoke.cpp -// -//----------------------------------------------------------------------------- - -#include -#include -#include "hc.hpp" - -int main() -{ - using namespace hc; - accelerator acc; - std::vector accv = acc.get_all() ; - - std::cout << "Found " << accv.size() << " accelerators." << std::endl; - std::cout << std::endl; - - unsigned long idefault = 0; - for(unsigned long i=0; i< accv.size(); i++) - { - accelerator a = accv[i]; - std::cout << "Accelerator " << i << ": " ; - std::wcout << a.get_device_path() << L" : " << a.get_description(); - std::cout << " : " << (a.get_version()>>16) << "." - << (a.get_version()&0xff); - std::cout << std::endl; - if (a == acc) { idefault = i; } - } - - std::cout << std::endl; - std::cout << "Default Accelerator " << ": " << idefault << " : " ; - std::wcout << acc.get_device_path() << std::endl; - - return 0; -} - diff --git a/tests/smoke/blt_hcc_smoke.cpp b/tests/smoke/blt_hcc_smoke.cpp deleted file mode 100644 index fdae9d013..000000000 --- a/tests/smoke/blt_hcc_smoke.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and -// other BLT Project Developers. See the top-level LICENSE file for details -// -// SPDX-License-Identifier: (BSD-3-Clause) - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// -// Note: This is a ROCM Hello world example from AMD: -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// - -//----------------------------------------------------------------------------- -// -// file: blt_hcc_smoke.cpp -// -//----------------------------------------------------------------------------- - -#include -#include - -int main() -{ - hc::parallel_for_each(hc::extent<1>(1), []() [[hc]] - { - hc::printf("Accelerator: Hello World!\n"); - }).wait(); - - return 0; -} - - From 1303b2a5e6efd34022c71080ca312c2e4f52369a Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 13 Apr 2022 16:14:25 -0700 Subject: [PATCH 29/30] bump version to 0.5.1 --- RELEASE-NOTES.md | 5 ++++- SetupBLT.cmake | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c47fdde1e..e6a008a5d 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -9,6 +9,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ ## [Unreleased] - Release date yyyy-mm-dd +## [Version 0.5.1] - Release date 2022-04-22 + ### Added - Added support for C++20. Note: XL does not support C++20. While PGI has C++20 support, it is currently disabled (A BLT fatal error will occur). @@ -249,7 +251,8 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ -[Unreleased]: https://github.com/LLNL/blt/compare/v0.5.0...develop +[Unreleased]: https://github.com/LLNL/blt/compare/v0.5.1...develop +[Version 0.5.1]: https://github.com/LLNL/blt/compare/v0.5.0...v0.5.1 [Version 0.5.0]: https://github.com/LLNL/blt/compare/v0.4.1...v0.5.0 [Version 0.4.1]: https://github.com/LLNL/blt/compare/v0.4.0...v0.4.1 [Version 0.4.0]: https://github.com/LLNL/blt/compare/v0.3.6...v0.4.0 diff --git a/SetupBLT.cmake b/SetupBLT.cmake index be80c5a47..460c8d75c 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -4,7 +4,7 @@ # SPDX-License-Identifier: (BSD-3-Clause) if (NOT BLT_LOADED) - set(BLT_VERSION "0.5.0" CACHE STRING "") + set(BLT_VERSION "0.5.1" CACHE STRING "") mark_as_advanced(BLT_VERSION) message(STATUS "BLT Version: ${BLT_VERSION}") From 583be9817c5d625bee24dc62529d1f425c72db3d Mon Sep 17 00:00:00 2001 From: Chris White Date: Wed, 13 Apr 2022 16:18:29 -0700 Subject: [PATCH 30/30] put release note in correct release section --- RELEASE-NOTES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e6a008a5d..60519a26e 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -22,6 +22,9 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ - Removed extra HIP offload flags that were being added as generator expressions as opposed to simple flags. +### Removed +- Removed support for deprecated HCC. + ## [Version 0.5.0] - Release date 2022-03-07 ### Added @@ -44,9 +47,6 @@ The project release numbers follow [Semantic Versioning](http://semver.org/spec/ for more user customization and to improve handling of file names with multiple periods, e.g. `1d.cube.order2.c` is considered a `.c` file. -### Removed -- Removed support for deprecated HCC. - ## [Version 0.4.1] - Release date 2021-07-20 ### Added