Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Eliminate further -Wunused-local-typedef warnings from gcc 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhoberock committed Dec 14, 2013
1 parent de4158f commit 24d2e73
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
10 changes: 9 additions & 1 deletion thrust/detail/static_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,16 @@ template<typename, bool x>

} // end thrust

#define THRUST_STATIC_ASSERT( B ) \
#if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_GCC) && (THRUST_GCC_VERSION >= 40800)
// gcc 4.8+ will complain about this typedef being unused unless we annotate it as such
# define THRUST_STATIC_ASSERT( B ) \
typedef ::thrust::detail::static_assert_test<\
sizeof(::thrust::detail::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
THRUST_JOIN(thrust_static_assert_typedef_, __LINE__) __attribute__((unused))
#else
# define THRUST_STATIC_ASSERT( B ) \
typedef ::thrust::detail::static_assert_test<\
sizeof(::thrust::detail::STATIC_ASSERTION_FAILURE< (bool)( B ) >)>\
THRUST_JOIN(thrust_static_assert_typedef_, __LINE__)
#endif // gcc 4.8+

3 changes: 0 additions & 3 deletions thrust/system/cuda/detail/copy_if.inl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ struct copy_if_intervals_closure
__device__ __thrust_forceinline__
void operator()(void)
{
typedef typename thrust::iterator_value<OutputIterator>::type OutputType;

typedef unsigned int PredicateType;

const unsigned int CTA_SIZE = context_type::ThreadsPerBlock::value;
Expand Down Expand Up @@ -166,7 +164,6 @@ template<typename DerivedPolicy,
Predicate pred)
{
typedef typename thrust::iterator_difference<InputIterator1>::type IndexType;
typedef typename thrust::iterator_value<OutputIterator>::type OutputType;

if (first == last)
return output;
Expand Down
2 changes: 0 additions & 2 deletions thrust/system/cuda/detail/reduce_by_key.inl
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ struct reduce_by_key_closure
__device__ __thrust_forceinline__
void operator()(void)
{
typedef typename thrust::iterator_value<InputIterator1>::type KeyType;
typedef typename thrust::iterator_value<ValueIterator>::type ValueType;
typedef typename Decomposition::index_type IndexType;
typedef typename thrust::iterator_value<FlagIterator>::type FlagType;
Expand Down Expand Up @@ -580,7 +579,6 @@ template <typename DerivedPolicy,

// temporary arrays
typedef thrust::detail::temporary_array<IndexType,DerivedPolicy> IndexArray;
typedef thrust::detail::temporary_array<KeyType,DerivedPolicy> KeyArray;
typedef thrust::detail::temporary_array<ValueType,DerivedPolicy> ValueArray;
typedef thrust::detail::temporary_array<bool,DerivedPolicy> BoolArray;

Expand Down
2 changes: 0 additions & 2 deletions thrust/system/detail/generic/count.inl
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ template <typename DerivedPolicy, typename InputIterator, typename EqualityCompa
typename thrust::iterator_traits<InputIterator>::difference_type
count(thrust::execution_policy<DerivedPolicy> &exec, InputIterator first, InputIterator last, const EqualityComparable& value)
{
typedef typename thrust::iterator_traits<InputIterator>::value_type InputType;

// XXX use placeholder expression here
return thrust::count_if(exec, first, last, thrust::detail::equal_to_value<EqualityComparable>(value));
} // end count()
Expand Down
1 change: 0 additions & 1 deletion thrust/system/detail/generic/reduce_by_key.inl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ template<typename ExecutionPolicy,
BinaryFunction binary_op)
{
typedef typename thrust::iterator_traits<InputIterator1>::difference_type difference_type;
typedef typename thrust::iterator_traits<InputIterator1>::value_type KeyType;

typedef unsigned int FlagType; // TODO use difference_type

Expand Down
1 change: 0 additions & 1 deletion thrust/system/detail/generic/replace.inl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ template<typename DerivedPolicy, typename InputIterator, typename OutputIterator
Predicate pred,
const T &new_value)
{
typedef typename thrust::iterator_traits<InputIterator>::value_type InputType;
typedef typename thrust::iterator_traits<OutputIterator>::value_type OutputType;

detail::new_value_if<Predicate,T,OutputType> op(pred,new_value);
Expand Down
1 change: 0 additions & 1 deletion thrust/system/omp/detail/for_each.inl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ RandomAccessIterator for_each_n(execution_policy<DerivedPolicy> &,
if (n <= 0) return first; //empty range

// create a wrapped function for f
typedef typename thrust::iterator_reference<RandomAccessIterator>::type reference;
thrust::detail::host_function<UnaryFunction,void> wrapped_f(f);

// do not attempt to compile the body of this function, which depends on #pragma omp,
Expand Down

0 comments on commit 24d2e73

Please sign in to comment.