Skip to content

Commit

Permalink
[Thrust] Remove pre-c++17 conditions and code (#3687)
Browse files Browse the repository at this point in the history
* Remove _CCCL_STD_VER <= 2014

* remove THRUST_MULTICONFIG_ENABLE_DIALECT_CPP11

* remove THRUST_GCC12_OMP_MISCOMPILE

* replace THRUST_OPTIONAL_CPP11_CONSTEXPR with constexpr

* remove THRUST_OPTIONAL_CPP14

* remove THRUST_OPTIONAL_CPP14

* remove c++11/14 from DetectSupportedStandards.cmake
  • Loading branch information
fbusato authored Feb 5, 2025
1 parent 5565801 commit 227bf11
Show file tree
Hide file tree
Showing 66 changed files with 531 additions and 912 deletions.
5 changes: 2 additions & 3 deletions thrust/cmake/DetectSupportedStandards.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
# - lang: The language to test: C, CXX, or CUDA.
# - standards: List of any standard versions.
#
# Example: detect_supported_cxx_standards(PROJ CXX 11 14 17)
# Example: detect_supported_cxx_standards(PROJ CXX 17 20)
# - Sets the following variables in the parent scope to TRUE or FALSE:
# - PROJ_CXX_11_SUPPORTED
# - PROJ_CXX_14_SUPPORTED
# - PROJ_CXX_17_SUPPORTED
# - PROJ_CXX_20_SUPPORTED
#
function(detect_supported_standards prefix lang)
string(TOLOWER "${lang}_std" feature_prefix)
Expand Down
11 changes: 0 additions & 11 deletions thrust/cmake/ThrustBuildTargetList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,6 @@ function(_thrust_build_target_list_multiconfig)
endif()
endif()

# Supported versions of MSVC do not distinguish between C++11 and C++14.
# Warn the user that they may be generating a ton of redundant targets if
# they explicitly requested this configuration.
if ("MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}" AND
THRUST_MULTICONFIG_ENABLE_DIALECT_CPP11)
message(WARNING
"Supported versions of MSVC (2017+) do not distinguish between C++11 "
"and C++14. The requested C++11 targets may be redundant."
)
endif()

# Build THRUST_TARGETS
foreach(host IN LISTS THRUST_HOST_SYSTEM_OPTIONS)
foreach(device IN LISTS THRUST_DEVICE_SYSTEM_OPTIONS)
Expand Down
12 changes: 4 additions & 8 deletions thrust/testing/async/exclusive_scan/counting_iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
#include <algorithm>
#include <limits>

# include <algorithm>
# include <limits>

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

template <typename input_value_type,
typename output_value_type = input_value_type,
Expand Down Expand Up @@ -43,6 +41,4 @@ struct test_counting_iterator
// the custom_numeric.
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_counting_iterator, UnsignedIntegralTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
8 changes: 2 additions & 6 deletions thrust/testing/async/exclusive_scan/discard_output.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

// Compilation test with discard iterators. No runtime validation is actually
// performed, other than testing whether the algorithm completes without
Expand Down Expand Up @@ -40,6 +38,4 @@ struct test_discard
};
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_discard, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
22 changes: 9 additions & 13 deletions thrust/testing/async/exclusive_scan/large_indices.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
#include <thrust/device_free.h>
#include <thrust/device_malloc.h>
#include <thrust/device_ptr.h>
#include <thrust/iterator/detail/device_system_tag.h>
#include <thrust/iterator/detail/iterator_facade_category.h>
#include <thrust/optional.h>

# include <thrust/device_free.h>
# include <thrust/device_malloc.h>
# include <thrust/device_ptr.h>
# include <thrust/iterator/detail/device_system_tag.h>
# include <thrust/iterator/detail/iterator_facade_category.h>
# include <thrust/optional.h>
#include <cstdint>

# include <cstdint>

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

// This test is an adaptation of TestInclusiveScanWithBigIndices from scan.cu.

Expand Down Expand Up @@ -240,6 +238,4 @@ void test_large_indices_custom_scan_op()
}
DECLARE_UNITTEST(test_large_indices_custom_scan_op);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
10 changes: 3 additions & 7 deletions thrust/testing/async/exclusive_scan/large_types.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
# include <unittest/special_types.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>
#include <unittest/special_types.h>

// This test is an adaptation of TestScanWithLargeTypes from scan.cu.

Expand Down Expand Up @@ -55,6 +53,4 @@ struct test_large_types
};
DECLARE_UNITTEST(test_large_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
8 changes: 2 additions & 6 deletions thrust/testing/async/exclusive_scan/mixed_types.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

// Test using mixed int/float types for:
// - input_value_type | (int, float)
Expand Down Expand Up @@ -118,6 +116,4 @@ void test_scan_mixed_types(size_t num_values)
}
DECLARE_SIZED_UNITTEST(test_scan_mixed_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
10 changes: 3 additions & 7 deletions thrust/testing/async/exclusive_scan/mixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
#include <thrust/async/scan.h>
#include <thrust/scan.h>

# include <thrust/async/scan.h>
# include <thrust/scan.h>

# include <async/mixin.h>
#include <async/mixin.h>

namespace testing
{
Expand Down Expand Up @@ -111,5 +109,3 @@ struct simple
} // namespace exclusive_scan
} // namespace async
} // namespace testing

#endif // C++14
8 changes: 2 additions & 6 deletions thrust/testing/async/exclusive_scan/simple.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

template <typename input_value_type,
typename output_value_type = input_value_type,
Expand Down Expand Up @@ -68,6 +66,4 @@ struct test_simple_in_place
};
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_simple_in_place, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
8 changes: 2 additions & 6 deletions thrust/testing/async/exclusive_scan/stateful_operator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

namespace
{
Expand Down Expand Up @@ -65,6 +63,4 @@ struct test_stateful_operator
};
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_stateful_operator, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
8 changes: 2 additions & 6 deletions thrust/testing/async/exclusive_scan/using_vs_adl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/exclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/exclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

// Verify what happens when calling the algorithm without any namespace
// qualifiers:
Expand Down Expand Up @@ -171,6 +169,4 @@ void test_using_cpo()
}
DECLARE_UNITTEST(test_using_cpo);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
12 changes: 4 additions & 8 deletions thrust/testing/async/inclusive_scan/counting_iterator.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
#include <algorithm>
#include <limits>

# include <algorithm>
# include <limits>

# include <async/inclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/inclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

template <typename input_value_type,
typename output_value_type = input_value_type,
Expand Down Expand Up @@ -42,6 +40,4 @@ struct test_counting_iterator
// the custom_numeric.
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_counting_iterator, UnsignedIntegralTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
8 changes: 2 additions & 6 deletions thrust/testing/async/inclusive_scan/discard_output.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/inclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/inclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

// Compilation test with discard iterators. No runtime validation is actually
// performed, other than testing whether the algorithm completes without
Expand Down Expand Up @@ -38,6 +36,4 @@ struct test_discard
};
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_discard, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
22 changes: 9 additions & 13 deletions thrust/testing/async/inclusive_scan/large_indices.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
#include <thrust/device_free.h>
#include <thrust/device_malloc.h>
#include <thrust/device_ptr.h>
#include <thrust/iterator/detail/device_system_tag.h>
#include <thrust/iterator/detail/iterator_facade_category.h>
#include <thrust/optional.h>

# include <thrust/device_free.h>
# include <thrust/device_malloc.h>
# include <thrust/device_ptr.h>
# include <thrust/iterator/detail/device_system_tag.h>
# include <thrust/iterator/detail/iterator_facade_category.h>
# include <thrust/optional.h>
#include <cstdint>

# include <cstdint>

# include <async/inclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/inclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

// This test is an adaptation of TestInclusiveScanWithBigIndices from scan.cu.

Expand Down Expand Up @@ -235,6 +233,4 @@ void test_large_indices_custom_scan_op()
}
DECLARE_UNITTEST(test_large_indices_custom_scan_op);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
10 changes: 3 additions & 7 deletions thrust/testing/async/inclusive_scan/large_types.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/inclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
# include <unittest/special_types.h>
#include <async/inclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>
#include <unittest/special_types.h>

// This test is an adaptation of TestScanWithLargeTypes from scan.cu.

Expand Down Expand Up @@ -55,6 +53,4 @@ struct test_large_types
};
DECLARE_UNITTEST(test_large_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
8 changes: 2 additions & 6 deletions thrust/testing/async/inclusive_scan/mixed_types.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014

# include <async/inclusive_scan/mixin.h>
# include <async/test_policy_overloads.h>
#include <async/inclusive_scan/mixin.h>
#include <async/test_policy_overloads.h>

// Test using mixed int/float types for:
// - input_value_type | (int, float)
Expand Down Expand Up @@ -109,6 +107,4 @@ void test_scan_mixed_types(size_t num_values)
}
DECLARE_SIZED_UNITTEST(test_scan_mixed_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
10 changes: 3 additions & 7 deletions thrust/testing/async/inclusive_scan/mixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
#include <thrust/async/scan.h>
#include <thrust/scan.h>

# include <thrust/async/scan.h>
# include <thrust/scan.h>

# include <async/mixin.h>
#include <async/mixin.h>

namespace testing
{
Expand Down Expand Up @@ -127,5 +125,3 @@ struct simple
} // namespace inclusive_scan
} // namespace async
} // namespace testing

#endif // C++14
Loading

0 comments on commit 227bf11

Please sign in to comment.