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

Commit 34a9562

Browse files
authored
Merge pull request #1756 from mfbalin/copy_if-relax-output-iterator-requirements
copy_if doesn't require copy assignment operator for OutputIterator
2 parents b0c015a + d8a7d0f commit 34a9562

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

thrust/system/cuda/detail/cdp_dispatch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
// seq_impl unused.
4848
#define THRUST_CDP_DISPATCH(par_impl, seq_impl) \
49-
NV_IF_TARGET(NV_ANY_TARGET, par_impl)
49+
NV_IF_TARGET(NV_ANY_TARGET, par_impl, par_impl)
5050

5151
#else // THRUST_RDC_ENABLED
5252

thrust/system/cuda/detail/copy_if.h

+4-6
Original file line numberDiff line numberDiff line change
@@ -786,19 +786,18 @@ copy_if(execution_policy<Derived> &policy,
786786
OutputIterator result,
787787
Predicate pred)
788788
{
789-
THRUST_CDP_DISPATCH((result = __copy_if::copy_if(policy,
789+
THRUST_CDP_DISPATCH((return __copy_if::copy_if(policy,
790790
first,
791791
last,
792792
__copy_if::no_stencil_tag(),
793793
result,
794794
pred);),
795-
(result =
795+
(return
796796
thrust::copy_if(cvt_to_seq(derived_cast(policy)),
797797
first,
798798
last,
799799
result,
800800
pred);));
801-
return result;
802801
} // func copy_if
803802

804803
__thrust_exec_check_disable__
@@ -816,14 +815,13 @@ copy_if(execution_policy<Derived> &policy,
816815
Predicate pred)
817816
{
818817
THRUST_CDP_DISPATCH(
819-
(result = __copy_if::copy_if(policy, first, last, stencil, result, pred);),
820-
(result = thrust::copy_if(cvt_to_seq(derived_cast(policy)),
818+
(return __copy_if::copy_if(policy, first, last, stencil, result, pred);),
819+
(return thrust::copy_if(cvt_to_seq(derived_cast(policy)),
821820
first,
822821
last,
823822
stencil,
824823
result,
825824
pred);));
826-
return result;
827825
} // func copy_if
828826

829827
} // namespace cuda_cub

0 commit comments

Comments
 (0)