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

WIP: Remove legacy code for things we do not support #1152

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions doc/thrust.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2057,12 +2057,8 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

PREDEFINED = THRUST_NOEXCEPT=noexcept \
"THRUST_DEFAULT={}" \
"THRUST_NODISCARD=[[nodiscard]]" \
PREDEFINED = "THRUST_NODISCARD=[[nodiscard]]" \
"THRUST_MR_DEFAULT_ALIGNMENT=alignof(max_align_t)" \
"THRUST_FINAL=final" \
"THRUST_OVERRIDE=" \
"cuda_cub=system::cuda"

# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
Expand Down
6 changes: 3 additions & 3 deletions testing/allocator_aware_policies.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ struct test_allocator_t
test_allocator_t<int> test_allocator = test_allocator_t<int>();
const test_allocator_t<int> const_test_allocator = test_allocator_t<int>();

struct test_memory_resource_t THRUST_FINAL : thrust::mr::memory_resource<>
struct test_memory_resource_t final : thrust::mr::memory_resource<>
{
void * do_allocate(std::size_t size, std::size_t) THRUST_OVERRIDE
void * do_allocate(std::size_t size, std::size_t) override
{
return reinterpret_cast<void *>(size);
}

void do_deallocate(void * ptr, std::size_t size, std::size_t) THRUST_OVERRIDE
void do_deallocate(void * ptr, std::size_t size, std::size_t) override
{
ASSERT_EQUAL(ptr, reinterpret_cast<void *>(size));
}
Expand Down
6 changes: 3 additions & 3 deletions testing/mr_disjoint_pool.cu
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct pointer_traits<alloc_id>
};
}}

class dummy_resource THRUST_FINAL : public thrust::mr::memory_resource<alloc_id>
class dummy_resource final : public thrust::mr::memory_resource<alloc_id>
{
public:
dummy_resource() : id_to_allocate(0), id_to_deallocate(0)
Expand All @@ -63,7 +63,7 @@ public:
ASSERT_EQUAL(id_to_deallocate, 0u);
}

virtual alloc_id do_allocate(std::size_t bytes, std::size_t alignment) THRUST_OVERRIDE
virtual alloc_id do_allocate(std::size_t bytes, std::size_t alignment) override
{
ASSERT_EQUAL(static_cast<bool>(id_to_allocate), true);

Expand All @@ -77,7 +77,7 @@ public:
return ret;
}

virtual void do_deallocate(alloc_id p, std::size_t bytes, std::size_t alignment) THRUST_OVERRIDE
virtual void do_deallocate(alloc_id p, std::size_t bytes, std::size_t alignment) override
{
ASSERT_EQUAL(p.size, bytes);
ASSERT_EQUAL(p.alignment, alignment);
Expand Down
6 changes: 3 additions & 3 deletions testing/mr_pool.cu
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct tracked_pointer : thrust::iterator_facade<
}
};

class tracked_resource THRUST_FINAL : public thrust::mr::memory_resource<tracked_pointer<void> >
class tracked_resource final : public thrust::mr::memory_resource<tracked_pointer<void> >
{
public:
tracked_resource() : id_to_allocate(0), id_to_deallocate(0)
Expand All @@ -121,7 +121,7 @@ public:
ASSERT_EQUAL(id_to_deallocate, 0u);
}

virtual tracked_pointer<void> do_allocate(std::size_t n, std::size_t alignment = THRUST_MR_DEFAULT_ALIGNMENT) THRUST_OVERRIDE
virtual tracked_pointer<void> do_allocate(std::size_t n, std::size_t alignment = THRUST_MR_DEFAULT_ALIGNMENT) override
{
ASSERT_EQUAL(static_cast<bool>(id_to_allocate), true);

Expand All @@ -136,7 +136,7 @@ public:
return ret;
}

virtual void do_deallocate(tracked_pointer<void> p, std::size_t n, std::size_t alignment = THRUST_MR_DEFAULT_ALIGNMENT) THRUST_OVERRIDE
virtual void do_deallocate(tracked_pointer<void> p, std::size_t n, std::size_t alignment = THRUST_MR_DEFAULT_ALIGNMENT) override
{
ASSERT_EQUAL(p.size, n);
ASSERT_EQUAL(p.alignment, alignment);
Expand Down
6 changes: 2 additions & 4 deletions thrust/addressof.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

#include <thrust/detail/config.h>

#if THRUST_CPP_DIALECT >= 2011
# include <memory>
#endif
#include <memory>

namespace thrust
{
Expand All @@ -20,7 +18,7 @@ namespace thrust
*/
template <typename T>
__host__ __device__
T* addressof(T& arg)
T* addressof(T& arg)
{
return reinterpret_cast<T*>(
&const_cast<char&>(reinterpret_cast<const volatile char&>(arg))
Expand Down
8 changes: 1 addition & 7 deletions thrust/allocate_unique.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#pragma once

#include <thrust/detail/config.h>
#include <thrust/detail/cpp11_required.h>

#if THRUST_CPP_DIALECT >= 2011

#include <thrust/detail/raw_pointer_cast.h>
#include <thrust/detail/type_deduction.h>
#include <thrust/detail/memory_algorithms.h>
Expand Down Expand Up @@ -246,7 +242,7 @@ struct array_allocator_delete final
allocator_type alloc_;
std::size_t count_;
};

template <typename T, typename Allocator>
using uninitialized_array_allocator_delete
= array_allocator_delete<T, Allocator, true>;
Expand Down Expand Up @@ -440,5 +436,3 @@ uninitialized_allocate_unique_n(

} // end namespace thrust

#endif // THRUST_CPP_DIALECT >= 2011

7 changes: 0 additions & 7 deletions thrust/async/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
#pragma once

#include <thrust/detail/config.h>
#include <thrust/detail/cpp11_required.h>
#include <thrust/detail/modern_gcc_required.h>

#if THRUST_CPP_DIALECT >= 2011 && !defined(THRUST_LEGACY_GCC)

#include <thrust/detail/static_assert.h>
#include <thrust/detail/select_system.h>
#include <thrust/type_traits/remove_cvref.h>
Expand Down Expand Up @@ -146,5 +141,3 @@ THRUST_INLINE_CONSTANT copy_detail::copy_fn copy{};

} // end namespace thrust

#endif

15 changes: 4 additions & 11 deletions thrust/async/for_each.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
#pragma once

#include <thrust/detail/config.h>
#include <thrust/detail/cpp11_required.h>
#include <thrust/detail/modern_gcc_required.h>

#if THRUST_CPP_DIALECT >= 2011 && !defined(THRUST_LEGACY_GCC)

#include <thrust/detail/static_assert.h>
#include <thrust/detail/select_system.h>
#include <thrust/type_traits/remove_cvref.h>
Expand Down Expand Up @@ -57,13 +52,13 @@ async_for_each(
, "this algorithm is not implemented for the specified system"
);
return {};
}
}

} // namespace unimplemented

namespace for_each_detail
{

using thrust::async::unimplemented::async_for_each;

struct for_each_fn final
Expand All @@ -76,7 +71,7 @@ struct for_each_fn final
static auto call(
thrust::detail::execution_policy_base<DerivedPolicy> const& exec
, ForwardIt&& first, Sentinel&& last
, UnaryFunction&& f
, UnaryFunction&& f
)
// ADL dispatch.
THRUST_DECLTYPE_RETURNS(
Expand All @@ -89,7 +84,7 @@ struct for_each_fn final

template <typename ForwardIt, typename Sentinel, typename UnaryFunction>
__host__
static auto call(ForwardIt&& first, Sentinel&& last, UnaryFunction&& f)
static auto call(ForwardIt&& first, Sentinel&& last, UnaryFunction&& f)
THRUST_DECLTYPE_RETURNS(
for_each_fn::call(
thrust::detail::select_system(
Expand All @@ -116,5 +111,3 @@ THRUST_INLINE_CONSTANT for_each_detail::for_each_fn for_each{};

} // end namespace thrust

#endif

17 changes: 5 additions & 12 deletions thrust/async/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
#pragma once

#include <thrust/detail/config.h>
#include <thrust/detail/cpp11_required.h>
#include <thrust/detail/modern_gcc_required.h>

#if THRUST_CPP_DIALECT >= 2011 && !defined(THRUST_LEGACY_GCC)

#include <thrust/detail/static_assert.h>
#include <thrust/detail/select_system.h>
#include <thrust/type_traits/logical_metafunctions.h>
Expand All @@ -48,7 +43,7 @@ template <
typename DerivedPolicy
, typename ForwardIt, typename Sentinel, typename T, typename BinaryOp
>
__host__
__host__
future<DerivedPolicy, T>
async_reduce(
thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, T, BinaryOp
Expand All @@ -59,7 +54,7 @@ async_reduce(
, "this algorithm is not implemented for the specified system"
);
return {};
}
}

} // namespace unimplemented

Expand Down Expand Up @@ -208,7 +203,7 @@ struct reduce_fn final
)

template <typename... Args>
THRUST_NODISCARD __host__
THRUST_NODISCARD __host__
auto operator()(Args&&... args) const
THRUST_DECLTYPE_RETURNS(
call(THRUST_FWD(args)...)
Expand Down Expand Up @@ -241,7 +236,7 @@ async_reduce_into(
, "this algorithm is not implemented for the specified system"
);
return {};
}
}

} // namespace unimplemented

Expand Down Expand Up @@ -423,7 +418,7 @@ struct reduce_into_fn final
)

template <typename... Args>
THRUST_NODISCARD __host__
THRUST_NODISCARD __host__
auto operator()(Args&&... args) const
THRUST_DECLTYPE_RETURNS(
call(THRUST_FWD(args)...)
Expand All @@ -438,5 +433,3 @@ THRUST_INLINE_CONSTANT reduce_into_detail::reduce_into_fn reduce_into{};

} // end namespace thrust

#endif

Loading