Skip to content

Commit 390fee9

Browse files
Drop Thrust's deprecated compiler macros
1 parent 31e49d4 commit 390fee9

File tree

6 files changed

+21
-147
lines changed

6 files changed

+21
-147
lines changed

thrust/cmake/ThrustHeaderTesting.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ function(thrust_add_header_test thrust_target label definitions)
125125
${header_definitions}
126126
"THRUST_CPP11_REQUIRED_NO_ERROR"
127127
"THRUST_CPP14_REQUIRED_NO_ERROR"
128-
"THRUST_MODERN_GCC_REQUIRED_NO_ERROR"
129128
)
130129
thrust_clone_target_properties(${headertest_target} ${thrust_target})
131130

thrust/examples/arbitrary_transformation.cu

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
#include <thrust/device_vector.h>
44
#include <thrust/for_each.h>
55
#include <thrust/iterator/zip_iterator.h>
6+
#include <thrust/zip_function.h>
67

78
#include <iostream>
89

9-
#if !defined(THRUST_LEGACY_GCC)
10-
# include <thrust/zip_function.h>
11-
#endif // >= C++11
12-
1310
#include "include/host_device.h"
1411

1512
// This example shows how to implement an arbitrary transformation of
@@ -54,7 +51,6 @@ struct arbitrary_functor1
5451
}
5552
};
5653

57-
#if !defined(THRUST_LEGACY_GCC)
5854
struct arbitrary_functor2
5955
{
6056
__host__ __device__ void operator()(const float& a, const float& b, const float& c, float& d)
@@ -63,7 +59,6 @@ struct arbitrary_functor2
6359
d = a + b * c;
6460
}
6561
};
66-
#endif // >= C++11
6762

6863
int main()
6964
{
@@ -95,7 +90,6 @@ int main()
9590
}
9691

9792
// apply the transformation using zip_function
98-
#if !defined(THRUST_LEGACY_GCC)
9993
thrust::device_vector<float> D2(5);
10094
thrust::for_each(thrust::make_zip_iterator(thrust::make_tuple(A.begin(), B.begin(), C.begin(), D2.begin())),
10195
thrust::make_zip_iterator(thrust::make_tuple(A.end(), B.end(), C.end(), D2.end())),
@@ -107,5 +101,4 @@ int main()
107101
{
108102
std::cout << A[i] << " + " << B[i] << " * " << C[i] << " = " << D2[i] << std::endl;
109103
}
110-
#endif // >= C++11
111104
}

thrust/testing/zip_function.cu

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
#include <thrust/detail/config.h>
22

3-
#if !defined(THRUST_LEGACY_GCC)
3+
#include <thrust/device_vector.h>
4+
#include <thrust/iterator/zip_iterator.h>
5+
#include <thrust/remove.h>
6+
#include <thrust/sort.h>
7+
#include <thrust/transform.h>
8+
#include <thrust/zip_function.h>
49

5-
# include <thrust/device_vector.h>
6-
# include <thrust/iterator/zip_iterator.h>
7-
# include <thrust/remove.h>
8-
# include <thrust/sort.h>
9-
# include <thrust/transform.h>
10-
# include <thrust/zip_function.h>
10+
#include <iostream>
1111

12-
# include <iostream>
13-
14-
# include <unittest/unittest.h>
12+
#include <unittest/unittest.h>
1513

1614
using namespace unittest;
1715

@@ -35,9 +33,9 @@ struct TestZipFunctionCtor
3533
{
3634
ASSERT_EQUAL(thrust::zip_function<SumThree>()(thrust::make_tuple(1, 2, 3)), SumThree{}(1, 2, 3));
3735
ASSERT_EQUAL(thrust::zip_function<SumThree>(SumThree{})(thrust::make_tuple(1, 2, 3)), SumThree{}(1, 2, 3));
38-
# ifdef __cpp_deduction_guides
36+
#ifdef __cpp_deduction_guides
3937
ASSERT_EQUAL(thrust::zip_function(SumThree{})(thrust::make_tuple(1, 2, 3)), SumThree{}(1, 2, 3));
40-
# endif // __cpp_deduction_guides
38+
#endif // __cpp_deduction_guides
4139
}
4240
};
4341
SimpleUnitTest<TestZipFunctionCtor, type_list<int>> TestZipFunctionCtorInstance;
@@ -176,4 +174,3 @@ struct TestNestedZipFunction2
176174
}
177175
};
178176
SimpleUnitTest<TestNestedZipFunction2, type_list<int, float>> TestNestedZipFunctionInstance2;
179-
#endif // _CCCL_STD_VER

thrust/thrust/detail/config/compiler.h

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -30,84 +30,6 @@
3030
# pragma system_header
3131
#endif // no system header
3232

33-
// enumerate host compilers we know about
34-
//! deprecated [Since 2.7]
35-
#define THRUST_HOST_COMPILER_UNKNOWN 0
36-
//! deprecated [Since 2.7]
37-
#define THRUST_HOST_COMPILER_MSVC 1
38-
//! deprecated [Since 2.7]
39-
#define THRUST_HOST_COMPILER_GCC 2
40-
//! deprecated [Since 2.7]
41-
#define THRUST_HOST_COMPILER_CLANG 3
42-
//! deprecated [Since 2.7]
43-
#define THRUST_HOST_COMPILER_INTEL 4
44-
45-
// enumerate device compilers we know about
46-
//! deprecated [Since 2.7]
47-
#define THRUST_DEVICE_COMPILER_UNKNOWN 0
48-
//! deprecated [Since 2.7]
49-
#define THRUST_DEVICE_COMPILER_MSVC 1
50-
//! deprecated [Since 2.7]
51-
#define THRUST_DEVICE_COMPILER_GCC 2
52-
//! deprecated [Since 2.7]
53-
#define THRUST_DEVICE_COMPILER_CLANG 3
54-
//! deprecated [Since 2.7]
55-
#define THRUST_DEVICE_COMPILER_NVCC 4
56-
57-
// figure out which host compiler we're using
58-
#if _CCCL_COMPILER(MSVC)
59-
//! deprecated [Since 2.7]
60-
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_MSVC
61-
//! deprecated [Since 2.7]
62-
# define THRUST_MSVC_VERSION _MSC_VER
63-
//! deprecated [Since 2.7]
64-
# define THRUST_MSVC_VERSION_FULL _MSC_FULL_VER
65-
#elif _CCCL_COMPILER(CLANG)
66-
//! deprecated [Since 2.7]
67-
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_CLANG
68-
//! deprecated [Since 2.7]
69-
# define THRUST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
70-
#elif _CCCL_COMPILER(GCC)
71-
//! deprecated [Since 2.7]
72-
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_GCC
73-
//! deprecated [Since 2.7]
74-
# define THRUST_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
75-
# if _CCCL_COMPILER(GCC, >=, 5)
76-
//! deprecated [Since 2.7]
77-
# define THRUST_MODERN_GCC
78-
# else
79-
//! deprecated [Since 2.7]
80-
# define THRUST_LEGACY_GCC
81-
# endif
82-
#else
83-
//! deprecated [Since 2.7]
84-
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_UNKNOWN
85-
#endif // TRUST_HOST_COMPILER
86-
87-
// figure out which device compiler we're using
88-
#if defined(__CUDACC__) || defined(_NVHPC_CUDA)
89-
//! deprecated [Since 2.7]
90-
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
91-
#elif _CCCL_COMPILER(MSVC)
92-
//! deprecated [Since 2.7]
93-
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_MSVC
94-
#elif _CCCL_COMPILER(GCC)
95-
//! deprecated [Since 2.7]
96-
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_GCC
97-
#elif _CCCL_COMPILER(CLANG)
98-
// CUDA-capable clang should behave similar to NVCC.
99-
# if defined(__CUDA__)
100-
//! deprecated [Since 2.7]
101-
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC
102-
# else
103-
//! deprecated [Since 2.7]
104-
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_CLANG
105-
# endif
106-
#else
107-
//! deprecated [Since 2.7]
108-
# define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_UNKNOWN
109-
#endif
110-
11133
// is the device compiler capable of compiling omp?
11234
#if defined(_OPENMP) || defined(_NVHPC_STDPAR_OPENMP)
11335
# define THRUST_DEVICE_COMPILER_IS_OMP_CAPABLE THRUST_TRUE

thrust/thrust/detail/modern_gcc_required.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

thrust/thrust/zip_function.h

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
1717
# pragma system_header
1818
#endif // no system header
19-
#include <thrust/detail/modern_gcc_required.h>
20-
#if !defined(THRUST_LEGACY_GCC)
2119

22-
# include <thrust/detail/type_deduction.h>
23-
# include <thrust/tuple.h>
24-
# include <thrust/type_traits/integer_sequence.h>
20+
#include <thrust/detail/type_deduction.h>
21+
#include <thrust/tuple.h>
22+
#include <thrust/type_traits/integer_sequence.h>
2523

26-
# include <cuda/functional>
24+
#include <cuda/functional>
2725

2826
THRUST_NAMESPACE_BEGIN
2927

@@ -42,7 +40,7 @@ namespace zip_detail
4240
{
4341

4442
// Add workaround for decltype(auto) on C++11-only compilers:
45-
# if _CCCL_STD_VER >= 2014
43+
#if _CCCL_STD_VER >= 2014
4644

4745
_CCCL_EXEC_CHECK_DISABLE
4846
template <typename Function, typename Tuple, std::size_t... Is>
@@ -58,7 +56,7 @@ _CCCL_HOST_DEVICE decltype(auto) apply(Function&& func, Tuple&& args)
5856
return apply_impl(THRUST_FWD(func), THRUST_FWD(args), make_index_sequence<tuple_size>{});
5957
}
6058

61-
# else // _CCCL_STD_VER
59+
#else // _CCCL_STD_VER
6260

6361
_CCCL_EXEC_CHECK_DISABLE
6462
template <typename Function, typename Tuple, std::size_t... Is>
@@ -71,7 +69,7 @@ _CCCL_HOST_DEVICE auto apply_impl(Function&& func, Tuple&& args, index_sequence<
7169
THRUST_FWD(args),
7270
make_index_sequence<thrust::tuple_size<typename std::decay<Tuple>::type>::value>{}))
7371

74-
# endif // _CCCL_STD_VER
72+
#endif // _CCCL_STD_VER
7573

7674
} // namespace zip_detail
7775
} // namespace detail
@@ -149,15 +147,15 @@ class zip_function
149147
{}
150148

151149
// Add workaround for decltype(auto) on C++11-only compilers:
152-
# if _CCCL_STD_VER >= 2014
150+
#if _CCCL_STD_VER >= 2014
153151

154152
template <typename Tuple>
155153
_CCCL_HOST_DEVICE decltype(auto) operator()(Tuple&& args) const
156154
{
157155
return detail::zip_detail::apply(func, THRUST_FWD(args));
158156
}
159157

160-
# else // _CCCL_STD_VER
158+
#else // _CCCL_STD_VER
161159

162160
// Can't just use THRUST_DECLTYPE_RETURNS here since we need to use
163161
// std::declval for the signature components:
@@ -169,7 +167,7 @@ class zip_function
169167
return detail::zip_detail::apply(func, THRUST_FWD(args));
170168
}
171169

172-
# endif // _CCCL_STD_VER
170+
#endif // _CCCL_STD_VER
173171

174172
//! Returns a reference to the underlying function.
175173
_CCCL_HOST_DEVICE Function& underlying_function() const
@@ -208,5 +206,3 @@ template <typename F>
208206
struct proclaims_copyable_arguments<THRUST_NS_QUALIFIER::zip_function<F>> : proclaims_copyable_arguments<F>
209207
{};
210208
_LIBCUDACXX_END_NAMESPACE_CUDA
211-
212-
#endif

0 commit comments

Comments
 (0)