From 8aafa9ff653f80bde04af53e7fe5eafab4084bf7 Mon Sep 17 00:00:00 2001 From: Alex Voicu Date: Wed, 24 Jan 2024 20:58:35 +0000 Subject: [PATCH] Fix misuses of `for_each`'s return value. Relocate header. (#368) --- .../system/hip/{ => hipstdpar}/hipstdpar_lib.hpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) rename thrust/system/hip/{ => hipstdpar}/hipstdpar_lib.hpp (99%) diff --git a/thrust/system/hip/hipstdpar_lib.hpp b/thrust/system/hip/hipstdpar/hipstdpar_lib.hpp similarity index 99% rename from thrust/system/hip/hipstdpar_lib.hpp rename to thrust/system/hip/hipstdpar/hipstdpar_lib.hpp index d9667ea7..0396c860 100644 --- a/thrust/system/hip/hipstdpar_lib.hpp +++ b/thrust/system/hip/hipstdpar/hipstdpar_lib.hpp @@ -714,9 +714,7 @@ inline void destroy(execution::parallel_unsequenced_policy, I f, I l) { - return ::thrust::for_each(f, l, [](auto& x) { - destroy_at(addressof(x)); - }); + ::thrust::for_each(f, l, [](auto& x) { destroy_at(addressof(x)); }); } template< @@ -740,7 +738,7 @@ inline void destroy_n(execution::parallel_unsequenced_policy, I f, N n) { - return ::thrust::for_each_n(f, n, [](auto& x) { + ::thrust::for_each_n(f, n, [](auto& x) { destroy_at(addressof(x)); }); } @@ -1158,7 +1156,7 @@ inline void for_each(execution::parallel_unsequenced_policy, I f, I l, F fn) { - return ::thrust::for_each(::thrust::device, f, l, ::std::move(fn)); + ::thrust::for_each(::thrust::device, f, l, ::std::move(fn)); } template< @@ -3942,7 +3940,7 @@ void uninitialized_default_construct( execution::parallel_unsequenced_policy, I f, I l) { - return ::thrust::for_each(::thrust::device, f, l, [](auto& x) { + ::thrust::for_each(::thrust::device, f, l, [](auto& x) { auto p = const_cast( static_cast((addressof(x)))); ::new (p) typename iterator_traits::value_type; @@ -3973,7 +3971,7 @@ void uninitialized_default_construct_n( execution::parallel_unsequenced_policy, I f, N n) { - return ::thrust::for_each_n(::thrust::device, f, n, [](auto& x) { + ::thrust::for_each_n(::thrust::device, f, n, [](auto& x) { auto p = const_cast( static_cast((addressof(x)))); ::new (p) typename iterator_traits::value_type; @@ -4124,7 +4122,7 @@ void uninitialized_value_construct( execution::parallel_unsequenced_policy, I f, I l) { - return ::thrust::for_each(::thrust::device, f, l, [](auto& x) { + ::thrust::for_each(::thrust::device, f, l, [](auto& x) { auto p = const_cast( static_cast((addressof(x)))); ::new (p) typename iterator_traits::value_type{}; @@ -4155,7 +4153,7 @@ void uninitialized_value_construct_n( execution::parallel_unsequenced_policy, I f, N n) { - return ::thrust::for_each_n(::thrust::device, f, n, [](auto& x) { + ::thrust::for_each_n(::thrust::device, f, n, [](auto& x) { auto p = const_cast( static_cast((addressof(x)))); ::new (p) typename iterator_traits::value_type{};