Fix compilation errors in C++14 mode.
Bug
Bug
MODIFY
testing/allocator_aware_policies.cu
testing/allocator_aware_policies.cu
@@ -14,7 +14,7 @@ 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::mr::memory_resource<>
+struct test_memory_resource_t THRUST_FINAL : thrust::mr::memory_resource<>
{
void * do_allocate(std::size_t, std::size_t) THRUST_OVERRIDE
{

MODIFY
testing/mr_disjoint_pool.cu
testing/mr_disjoint_pool.cu
@@ -46,7 +46,7 @@ struct thrust::detail::pointer_traits<alloc_id>
}
};
-class dummy_resource : public thrust::mr::memory_resource<alloc_id>
+class dummy_resource THRUST_FINAL : public thrust::mr::memory_resource<alloc_id>
{
public:
dummy_resource() : id_to_allocate(0), id_to_deallocate(0)

MODIFY
testing/mr_pool.cu
testing/mr_pool.cu
@@ -106,7 +106,7 @@ struct tracked_pointer : thrust::iterator_facade<
}
};
-class tracked_resource : public thrust::mr::memory_resource<tracked_pointer<void> >
+class tracked_resource THRUST_FINAL : public thrust::mr::memory_resource<tracked_pointer<void> >
{
public:
tracked_resource() : id_to_allocate(0), id_to_deallocate(0)

MODIFY
thrust/mr/disjoint_pool.h
thrust/mr/disjoint_pool.h
@@ -69,7 +69,7 @@ namespace mr
* \tparam Bookkeeper the type of memory resources that will be used for allocating bookkeeping memory
*/
template<typename Upstream, typename Bookkeeper>
-class disjoint_unsynchronized_pool_resource
+class disjoint_unsynchronized_pool_resource THRUST_FINAL
: public memory_resource<typename Upstream::pointer>,
private validator2<Upstream, Bookkeeper>
{

MODIFY
thrust/mr/new.h
thrust/mr/new.h
@@ -65,13 +65,6 @@ public:
{
#if __cplusplus >= 201703L
::operator delete(p, bytes, std::align_val_t(alignment));
-#elif __cplusplus >= 201402L
- char * ptr = static_cast<char *>(p);
- // calculate where the offset is stored
- std::size_t * offset = static_cast<std::size_t *>(ptr + bytes);
- p = static_cast<void *>(ptr - *offset);
- // calculate the original pointer
- ::operator delete(p, bytes + alignment + sizeof(std::size_t));
#else
(void)alignment;
char * ptr = static_cast<char *>(p);

MODIFY
thrust/mr/pool.h
thrust/mr/pool.h
@@ -65,7 +65,7 @@ namespace mr
* \tparam Upstream the type of memory resources that will be used for allocating memory blocks
*/
template<typename Upstream>
-class unsynchronized_pool_resource
+class unsynchronized_pool_resource THRUST_FINAL
: public memory_resource<typename Upstream::pointer>,
private validator<Upstream>
{

Fix compilation errors in C++14 mode.

Bug 2446219
Bug 200467867