Skip to content

Commit

Permalink
Merge branch 'master' into partitioned_vector
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Aug 21, 2017
2 parents 3eaff5c + 7a01561 commit a6749f7
Show file tree
Hide file tree
Showing 81 changed files with 2,575 additions and 643 deletions.
39 changes: 26 additions & 13 deletions CMakeLists.txt
Expand Up @@ -7,6 +7,7 @@
# Copyright (c) 2014-2016 Andreas Schaefer
# Copyright (c) 2017 Abhimanyu Rawat
# Copyright (c) 2017 Google
# Copyright (c) 2017 Taeguk Kwon
#
# 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)
Expand Down Expand Up @@ -1100,27 +1101,39 @@ if(HPX_WITH_CUDA)
endif()
endif()

# Set default for enabling auto-return type workaround to ON for non-clang CUDA
# only
set(HPX_CXX11_AUTO_RETURN_VALUE_VALUE_DEFAULT ON)
if(HPX_WITH_CUDA AND NOT HPX_WITH_CUDA_CLANG)
set(HPX_CXX11_AUTO_RETURN_VALUE_VALUE_DEFAULT OFF)
endif()

hpx_option(HPX_WITH_CXX11_AUTO_RETURN_VALUE BOOL
"Enable the use of auto as a return value in some places. Overriding this flag is only necessary if the C++ compiler is not standard compliant, e.g. nvcc."
${HPX_CXX11_AUTO_RETURN_VALUE_VALUE_DEFAULT} ADVANCED)
if(HPX_WITH_CXX11_AUTO_RETURN_VALUE)
hpx_add_config_define(HPX_HAVE_CXX11_AUTO_RETURN_VALUE)
# Store option value passed by an user for HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION.
if(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION)
set(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION_ADVANCED )
set(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION_GIVEN ON)
else()
set(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION_ADVANCED ADVANCED)
set(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION_GIVEN OFF)
endif()

################################################################################
# C++ feature tests
################################################################################

include(HPX_PerformCxxFeatureTests)
hpx_perform_cxx_feature_tests()

# Exceptional handling for non-clang CUDA.
if(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION)
if(HPX_WITH_CUDA AND NOT HPX_WITH_CUDA_CLANG)
# means using default value (given value).
unset(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION)
endif()
endif()

# HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION
# Default value is used only when HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION is not defined.
hpx_option(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION BOOL
"Enable the use of auto as a return value in some places. Overriding this flag is only necessary if the C++ compiler is not standard compliant, e.g. nvcc."
${HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION_GIVEN}
${HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION_ADVANCED})
if(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION)
hpx_add_config_define(HPX_HAVE_CXX14_RETURN_TYPE_DEDUCTION)
endif()

# HPX_WITH_THREAD_COMPATIBILITY
hpx_option(HPX_WITH_THREAD_COMPATIBILITY BOOL
"Use a compatibility implementation of std::thread, i.e. fall back to Boost.Thread (default: OFF)"
Expand Down
10 changes: 7 additions & 3 deletions appveyor.yml
Expand Up @@ -5,8 +5,12 @@

version: '{branch}-{build}'

image:
- Visual Studio 2017
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
MSVC_GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
MSVC_GENERATOR: Visual Studio 15 2017

configuration:
- Debug
Expand All @@ -25,7 +29,7 @@ install:
- cmd: 7z x "C:\projects\vcpkg-export-hpx-dependencies.7z" -y -oC:\projects\vcpkg >NUL

before_build:
- cmd: cmake -H. -Bbuild -A%PLATFORM% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_TOOLCHAIN_FILE=C:/projects/vcpkg/scripts/buildsystems/vcpkg.cmake -DHPX_WITH_GIT_COMMIT=%APPVEYOR_REPO_COMMIT% -DHPX_WITH_PSEUDO_DEPENDENCIES=On -DHPX_WITH_EXAMPLES=On -DHPX_WITH_EXAMPLES_HDF5=On -DHPX_WITH_TESTS=Off -DHPX_WITH_RUNTIME=Off -DHPX_WITH_DEPRECATION_WARNINGS=Off
- cmd: cmake -H. -Bbuild -G"%MSVC_GENERATOR%" -A%PLATFORM% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_TOOLCHAIN_FILE=C:/projects/vcpkg/scripts/buildsystems/vcpkg.cmake -DHPX_WITH_GIT_COMMIT=%APPVEYOR_REPO_COMMIT% -DHPX_WITH_PSEUDO_DEPENDENCIES=On -DHPX_WITH_EXAMPLES=On -DHPX_WITH_EXAMPLES_HDF5=Off -DHPX_WITH_TESTS=Off -DHPX_WITH_RUNTIME=Off -DHPX_WITH_DEPRECATION_WARNINGS=Off

build_script:
- cmd: cmake --build build --config %CONFIGURATION% --target core -- /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal /maxcpucount:2 /nologo
Expand Down
3 changes: 2 additions & 1 deletion circle.yml
Expand Up @@ -25,7 +25,8 @@ dependencies:
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 core
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k components
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k examples
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k tests.unit
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k tests.unit.build tests.unit.diagnostics tests.unit.actions tests.unit.agas tests.unit.component tests.unit.computeapi tests.unit.lcos tests.unit.parcelset tests.unit.performance_counter tests.unit.serialization tests.unit.threads tests.unit.traits tests.unit.util
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k tests.unit.parallel
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k tests.regressions
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k tests.headers
- docker run -v $PWD:/hpx -w /hpx/build ${IMAGE_NAME} make -j2 -k tests.performance
Expand Down
16 changes: 16 additions & 0 deletions cmake/HPX_AddConfigTest.cmake
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) 2014 Thomas Heller
# Copyright (c) 2017 Denis Blank
# Copyright (c) 2017 Google
# Copyright (c) 2017 Taeguk Kwon
#
# 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)
Expand Down Expand Up @@ -515,6 +516,13 @@ macro(hpx_check_for_cxx11_std_unordered_set)
FILE ${ARGN})
endmacro()

###############################################################################
macro(hpx_check_for_cxx11_noreturn_attribute)
add_hpx_config_test(HPX_WITH_CXX11_NORETURN_ATTRIBUTE
SOURCE cmake/tests/cxx11_noreturn_attribute.cpp
FILE ${ARGN})
endmacro()

###############################################################################
macro(hpx_check_for_cxx14_constexpr)
add_hpx_config_test(HPX_WITH_CXX14_CONSTEXPR
Expand Down Expand Up @@ -572,6 +580,14 @@ macro(hpx_check_for_cxx14_deprecated_attribute)
FILE ${ARGN})
endmacro()

###############################################################################
macro(hpx_check_for_cxx14_return_type_deduction)
add_hpx_config_test(HPX_WITH_CXX14_RETURN_TYPE_DEDUCTION
SOURCE cmake/tests/cxx14_return_type_deduction.cpp
FILE ${ARGN}
CMAKECXXFEATURE cxx_return_type_deduction)
endmacro()

###############################################################################
macro(hpx_check_for_libfun_std_experimental_optional)
add_hpx_config_test(HPX_WITH_LIBFUN_EXPERIMENTAL_OPTIONAL
Expand Down
6 changes: 6 additions & 0 deletions cmake/HPX_PerformCxxFeatureTests.cmake
@@ -1,6 +1,7 @@
# Copyright (c) 2007-2017 Hartmut Kaiser
# Copyright (c) 2011-2014 Thomas Heller
# Copyright (c) 2013-2016 Agustin Berge
# Copyright (c) 2017 Taeguk Kwon
#
# 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)
Expand Down Expand Up @@ -136,6 +137,9 @@ macro(hpx_perform_cxx_feature_tests)
hpx_check_for_cxx11_std_unordered_set(
REQUIRED "HPX needs support for C++11 std::unordered_set")

hpx_check_for_cxx11_noreturn_attribute(
DEFINITIONS HPX_HAVE_CXX11_NORETURN_ATTRIBUTE)

if(HPX_WITH_CXX1Y OR HPX_WITH_CXX14 OR HPX_WITH_CXX1Z OR HPX_WITH_CXX17)
# Check the availability of certain C++14 language features
hpx_check_for_cxx14_constexpr(
Expand All @@ -162,6 +166,8 @@ macro(hpx_perform_cxx_feature_tests)

hpx_check_for_cxx14_deprecated_attribute(
DEFINITIONS HPX_HAVE_CXX14_DEPRECATED_ATTRIBUTE)

hpx_check_for_cxx14_return_type_deduction()

# check for experimental facilities

Expand Down
19 changes: 19 additions & 0 deletions cmake/tests/cxx11_noreturn_attribute.cpp
@@ -0,0 +1,19 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Hartmut Kaiser
//
// 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)
////////////////////////////////////////////////////////////////////////////////

#if !defined(__has_cpp_attribute)
# error "__has_cpp_attribute not supported, assume [[noreturn]] is not supported"
#else
# if !__has_cpp_attribute(noreturn)
# error "__has_cpp_attribute(noreturn) not supported"
# endif
#endif

int main()
{
return 0;
}
30 changes: 30 additions & 0 deletions cmake/tests/cxx14_return_type_deduction.cpp
@@ -0,0 +1,30 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2017 Taeguk Kwon
//
// 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)
////////////////////////////////////////////////////////////////////////////////

auto check(int a, int b)
{
int c = a + b;
return c;
}

template <typename T>
auto check2(T num);

template <typename T>
auto check2(T num)
{
return num * num;
}

int main()
{
int a = 10;
int b = 20;
check(a, b);
double c = check2(30.0);
}

0 comments on commit a6749f7

Please sign in to comment.