diff --git a/thrust/cmake/ThrustHeaderTesting.cmake b/thrust/cmake/ThrustHeaderTesting.cmake index 9a39c93e26a..2eb3e33b5d6 100644 --- a/thrust/cmake/ThrustHeaderTesting.cmake +++ b/thrust/cmake/ThrustHeaderTesting.cmake @@ -125,7 +125,6 @@ function(thrust_add_header_test thrust_target label definitions) ${header_definitions} "THRUST_CPP11_REQUIRED_NO_ERROR" "THRUST_CPP14_REQUIRED_NO_ERROR" - "THRUST_MODERN_GCC_REQUIRED_NO_ERROR" ) thrust_clone_target_properties(${headertest_target} ${thrust_target}) diff --git a/thrust/examples/arbitrary_transformation.cu b/thrust/examples/arbitrary_transformation.cu index ead08af9bb9..369794c6192 100644 --- a/thrust/examples/arbitrary_transformation.cu +++ b/thrust/examples/arbitrary_transformation.cu @@ -3,13 +3,10 @@ #include #include #include +#include #include -#if !defined(THRUST_LEGACY_GCC) -# include -#endif // >= C++11 - #include "include/host_device.h" // This example shows how to implement an arbitrary transformation of @@ -54,7 +51,6 @@ struct arbitrary_functor1 } }; -#if !defined(THRUST_LEGACY_GCC) struct arbitrary_functor2 { __host__ __device__ void operator()(const float& a, const float& b, const float& c, float& d) @@ -63,7 +59,6 @@ struct arbitrary_functor2 d = a + b * c; } }; -#endif // >= C++11 int main() { @@ -95,7 +90,6 @@ int main() } // apply the transformation using zip_function -#if !defined(THRUST_LEGACY_GCC) thrust::device_vector D2(5); thrust::for_each(thrust::make_zip_iterator(thrust::make_tuple(A.begin(), B.begin(), C.begin(), D2.begin())), thrust::make_zip_iterator(thrust::make_tuple(A.end(), B.end(), C.end(), D2.end())), @@ -107,5 +101,4 @@ int main() { std::cout << A[i] << " + " << B[i] << " * " << C[i] << " = " << D2[i] << std::endl; } -#endif // >= C++11 } diff --git a/thrust/testing/zip_function.cu b/thrust/testing/zip_function.cu index 2a7117a05b1..279960592b5 100644 --- a/thrust/testing/zip_function.cu +++ b/thrust/testing/zip_function.cu @@ -1,17 +1,15 @@ #include -#if !defined(THRUST_LEGACY_GCC) +#include +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include -# include +#include -# include - -# include +#include using namespace unittest; @@ -35,9 +33,9 @@ struct TestZipFunctionCtor { ASSERT_EQUAL(thrust::zip_function()(thrust::make_tuple(1, 2, 3)), SumThree{}(1, 2, 3)); ASSERT_EQUAL(thrust::zip_function(SumThree{})(thrust::make_tuple(1, 2, 3)), SumThree{}(1, 2, 3)); -# ifdef __cpp_deduction_guides +#ifdef __cpp_deduction_guides ASSERT_EQUAL(thrust::zip_function(SumThree{})(thrust::make_tuple(1, 2, 3)), SumThree{}(1, 2, 3)); -# endif // __cpp_deduction_guides +#endif // __cpp_deduction_guides } }; SimpleUnitTest> TestZipFunctionCtorInstance; @@ -176,4 +174,3 @@ struct TestNestedZipFunction2 } }; SimpleUnitTest> TestNestedZipFunctionInstance2; -#endif // _CCCL_STD_VER diff --git a/thrust/thrust/detail/config/compiler.h b/thrust/thrust/detail/config/compiler.h index 06a5f950712..0a74cf3baea 100644 --- a/thrust/thrust/detail/config/compiler.h +++ b/thrust/thrust/detail/config/compiler.h @@ -30,84 +30,6 @@ # pragma system_header #endif // no system header -// enumerate host compilers we know about -//! deprecated [Since 2.7] -#define THRUST_HOST_COMPILER_UNKNOWN 0 -//! deprecated [Since 2.7] -#define THRUST_HOST_COMPILER_MSVC 1 -//! deprecated [Since 2.7] -#define THRUST_HOST_COMPILER_GCC 2 -//! deprecated [Since 2.7] -#define THRUST_HOST_COMPILER_CLANG 3 -//! deprecated [Since 2.7] -#define THRUST_HOST_COMPILER_INTEL 4 - -// enumerate device compilers we know about -//! deprecated [Since 2.7] -#define THRUST_DEVICE_COMPILER_UNKNOWN 0 -//! deprecated [Since 2.7] -#define THRUST_DEVICE_COMPILER_MSVC 1 -//! deprecated [Since 2.7] -#define THRUST_DEVICE_COMPILER_GCC 2 -//! deprecated [Since 2.7] -#define THRUST_DEVICE_COMPILER_CLANG 3 -//! deprecated [Since 2.7] -#define THRUST_DEVICE_COMPILER_NVCC 4 - -// figure out which host compiler we're using -#if _CCCL_COMPILER(MSVC) -//! deprecated [Since 2.7] -# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_MSVC -//! deprecated [Since 2.7] -# define THRUST_MSVC_VERSION _MSC_VER -//! deprecated [Since 2.7] -# define THRUST_MSVC_VERSION_FULL _MSC_FULL_VER -#elif _CCCL_COMPILER(CLANG) -//! deprecated [Since 2.7] -# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_CLANG -//! deprecated [Since 2.7] -# define THRUST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) -#elif _CCCL_COMPILER(GCC) -//! deprecated [Since 2.7] -# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_GCC -//! deprecated [Since 2.7] -# define THRUST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) -# if _CCCL_COMPILER(GCC, >=, 5) -//! deprecated [Since 2.7] -# define THRUST_MODERN_GCC -# else -//! deprecated [Since 2.7] -# define THRUST_LEGACY_GCC -# endif -#else -//! deprecated [Since 2.7] -# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_UNKNOWN -#endif // TRUST_HOST_COMPILER - -// figure out which device compiler we're using -#if defined(__CUDACC__) || defined(_NVHPC_CUDA) -//! deprecated [Since 2.7] -# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC -#elif _CCCL_COMPILER(MSVC) -//! deprecated [Since 2.7] -# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_MSVC -#elif _CCCL_COMPILER(GCC) -//! deprecated [Since 2.7] -# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_GCC -#elif _CCCL_COMPILER(CLANG) -// CUDA-capable clang should behave similar to NVCC. -# if defined(__CUDA__) -//! deprecated [Since 2.7] -# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC -# else -//! deprecated [Since 2.7] -# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_CLANG -# endif -#else -//! deprecated [Since 2.7] -# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_UNKNOWN -#endif - // is the device compiler capable of compiling omp? #if defined(_OPENMP) || defined(_NVHPC_STDPAR_OPENMP) # define THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE THRUST_TRUE diff --git a/thrust/thrust/detail/modern_gcc_required.h b/thrust/thrust/detail/modern_gcc_required.h deleted file mode 100644 index b639d1d933a..00000000000 --- a/thrust/thrust/detail/modern_gcc_required.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2018 NVIDIA Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header - -#ifndef THRUST_MODERN_GCC_REQUIRED_NO_ERROR -# if _CCCL_COMPILER(GCC) && !defined(THRUST_MODERN_GCC) -# error GCC 5 or later is required for this Thrust feature; please upgrade your compiler. -# endif -#endif diff --git a/thrust/thrust/zip_function.h b/thrust/thrust/zip_function.h index 24c52cc34eb..e9bd1bf9848 100644 --- a/thrust/thrust/zip_function.h +++ b/thrust/thrust/zip_function.h @@ -16,14 +16,12 @@ #elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) # pragma system_header #endif // no system header -#include -#if !defined(THRUST_LEGACY_GCC) -# include -# include -# include +#include +#include +#include -# include +#include THRUST_NAMESPACE_BEGIN @@ -42,7 +40,7 @@ namespace zip_detail { // Add workaround for decltype(auto) on C++11-only compilers: -# if _CCCL_STD_VER >= 2014 +#if _CCCL_STD_VER >= 2014 _CCCL_EXEC_CHECK_DISABLE template @@ -58,7 +56,7 @@ _CCCL_HOST_DEVICE decltype(auto) apply(Function&& func, Tuple&& args) return apply_impl(THRUST_FWD(func), THRUST_FWD(args), make_index_sequence{}); } -# else // _CCCL_STD_VER +#else // _CCCL_STD_VER _CCCL_EXEC_CHECK_DISABLE template @@ -71,7 +69,7 @@ _CCCL_HOST_DEVICE auto apply_impl(Function&& func, Tuple&& args, index_sequence< THRUST_FWD(args), make_index_sequence::type>::value>{})) -# endif // _CCCL_STD_VER +#endif // _CCCL_STD_VER } // namespace zip_detail } // namespace detail @@ -149,7 +147,7 @@ class zip_function {} // Add workaround for decltype(auto) on C++11-only compilers: -# if _CCCL_STD_VER >= 2014 +#if _CCCL_STD_VER >= 2014 template _CCCL_HOST_DEVICE decltype(auto) operator()(Tuple&& args) const @@ -157,7 +155,7 @@ class zip_function return detail::zip_detail::apply(func, THRUST_FWD(args)); } -# else // _CCCL_STD_VER +#else // _CCCL_STD_VER // Can't just use THRUST_DECLTYPE_RETURNS here since we need to use // std::declval for the signature components: @@ -169,7 +167,7 @@ class zip_function return detail::zip_detail::apply(func, THRUST_FWD(args)); } -# endif // _CCCL_STD_VER +#endif // _CCCL_STD_VER //! Returns a reference to the underlying function. _CCCL_HOST_DEVICE Function& underlying_function() const @@ -208,5 +206,3 @@ template struct proclaims_copyable_arguments> : proclaims_copyable_arguments {}; _LIBCUDACXX_END_NAMESPACE_CUDA - -#endif