Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ jobs:
UMPIRE_ENABLE_TOOLS=Off
UMPIRE_ENABLE_DEVELOPER_BENCHMARKS=On
UMPIRE_ENABLE_BENCHMARKS=Off
BLT_CXX_STD="c++17"
CMAKE_CXX_STANDARD=17
BLT_CXX_STD="c++20"
CMAKE_CXX_STANDARD=20
CMAKE_BUILD_TYPE=Release
${{ matrix.shared.args }}
run-build: true
Expand Down
37 changes: 15 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# SPDX-License-Identifier: (MIT)
##############################################################################
cmake_minimum_required(VERSION 3.23)
cmake_minimum_required(VERSION 3.25)

cmake_policy(SET CMP0025 NEW)
cmake_policy(SET CMP0048 NEW)
Expand All @@ -26,33 +26,36 @@ set(UMPIRE_VERSION_RC "")

include(cmake/SetupUmpireOptions.cmake)

# Default to c++17 if not specified by the user.
set(BLT_CXX_STD "c++17" CACHE STRING "Version of C++ standard")
# Default to c++20 if not specified by the user.
set(BLT_CXX_STD "c++20" CACHE STRING "Version of C++ standard")

# If BLT_CXX_STD is set by the user, check that it is at least 17.
# If BLT_CXX_STD is set by the user, check that it is at least 20.
if("${BLT_CXX_STD}" STREQUAL "c++98" OR
"${BLT_CXX_STD}" STREQUAL "c++03" OR
"${BLT_CXX_STD}" STREQUAL "c++11" OR
"${BLT_CXX_STD}" STREQUAL "c++14")
message(FATAL_ERROR "Umpire requires a minimum C++ standard of c++17. Please set BLT_CXX_STD accordingly.")
"${BLT_CXX_STD}" STREQUAL "c++14" OR
"${BLT_CXX_STD}" STREQUAL "c++17")
message(FATAL_ERROR "Umpire requires a minimum C++ standard of c++20. Please set BLT_CXX_STD accordingly.")
endif()

# If CMAKE_CUDA_STANDARD is set by the user, check that it is at least 17.
# If CMAKE_CUDA_STANDARD is set by the user, check that it is at least 20.
# If it is not set, it will be set later by BLT to match BLT_CXX_STD.
if ("${CMAKE_CUDA_STANDARD}" STREQUAL "98" OR
"${CMAKE_CUDA_STANDARD}" STREQUAL "03" OR
"${CMAKE_CUDA_STANDARD}" STREQUAL "11" OR
"${CMAKE_CUDA_STANDARD}" STREQUAL "14")
message(FATAL_ERROR "Umpire requires a minimum CUDA standard of 17. Please set BLT_CXX_STD and/or CMAKE_CUDA_STANDARD accordingly.")
"${CMAKE_CUDA_STANDARD}" STREQUAL "14" OR
"${CMAKE_CUDA_STANDARD}" STREQUAL "17")
message(FATAL_ERROR "Umpire requires a minimum CUDA standard of 20. Please set BLT_CXX_STD and/or CMAKE_CUDA_STANDARD accordingly.")
endif()

# If CMAKE_HIP_STANDARD is set by the user, check that it is at least 17.
# If CMAKE_HIP_STANDARD is set by the user, check that it is at least 20.
# If it is not set, it will be set later by BLT to match BLT_CXX_STD.
if ("${CMAKE_HIP_STANDARD}" STREQUAL "98" OR
"${CMAKE_HIP_STANDARD}" STREQUAL "03" OR
"${CMAKE_HIP_STANDARD}" STREQUAL "11" OR
"${CMAKE_HIP_STANDARD}" STREQUAL "14")
message(FATAL_ERROR "Umpire requires a minimum HIP standard of 17. Please set BLT_CXX_STD and/or CMAKE_HIP_STANDARD accordingly.")
"${CMAKE_HIP_STANDARD}" STREQUAL "14" OR
"${CMAKE_HIP_STANDARD}" STREQUAL "17")
message(FATAL_ERROR "Umpire requires a minimum HIP standard of 20. Please set BLT_CXX_STD and/or CMAKE_HIP_STANDARD accordingly.")
endif()

if (UMPIRE_ENABLE_SYCL)
Expand Down Expand Up @@ -174,16 +177,6 @@ include(cmake/SetupCMakeBasics.cmake)
include(cmake/SetupCompilerFlags.cmake)
include(cmake/SetupUmpireThirdParty.cmake)

if (WIN32)
if ((NOT UMPIRE_ENABLE_FILESYSTEM) OR (CMAKE_CXX_STANDARD LESS 17))
message(FATAL_ERROR "\
Windows builds require the FileSystem to be enabled \
and the C/C++ standard to be set to 17 or higher. \
Please re-configure with UMPIRE_ENABLE_FILESYSTEM=ON, \
with BLT_CXX_STD=c++17 or greater.")
endif()
endif()

add_subdirectory(src)

configure_package_config_file(
Expand Down
2 changes: 1 addition & 1 deletion examples/resource_aware_pool_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ __device__ void sleep(clock_value_t sleep_cycles)
__global__ void do_sleep()
{
// sleep - works still at 1000, so keeping it at 100k
sleep(10000000);
sleep((clock_value_t)10000000);
}
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/tpl/umpire/CLI11/CLI11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6431,14 +6431,14 @@ struct AppFriend {
/// Wrap _parse_short, perfectly forward arguments and return
template <typename... Args>
static auto parse_arg(App *app, Args &&... args) ->
typename std::result_of<decltype (&App::_parse_arg)(App, Args...)>::type {
typename std::invoke_result<decltype (&App::_parse_arg), App, Args...>::type {
return app->_parse_arg(std::forward<Args>(args)...);
}

/// Wrap _parse_subcommand, perfectly forward arguments and return
template <typename... Args>
static auto parse_subcommand(App *app, Args &&... args) ->
typename std::result_of<decltype (&App::_parse_subcommand)(App, Args...)>::type {
typename std::invoke_result<decltype (&App::_parse_subcommand), App, Args...>::type {
return app->_parse_subcommand(std::forward<Args>(args)...);
}
/// Wrap the fallthrough parent function to make sure that is working correctly
Expand Down
Loading