diff --git a/thrust/system/cuda/detail/cdp_dispatch.h b/thrust/system/cuda/detail/cdp_dispatch.h index c78798224..4d0b98c75 100644 --- a/thrust/system/cuda/detail/cdp_dispatch.h +++ b/thrust/system/cuda/detail/cdp_dispatch.h @@ -46,7 +46,7 @@ // seq_impl unused. #define THRUST_CDP_DISPATCH(par_impl, seq_impl) \ - NV_IF_TARGET(NV_ANY_TARGET, par_impl) + NV_IF_TARGET(NV_ANY_TARGET, par_impl, par_impl) #else // THRUST_RDC_ENABLED diff --git a/thrust/system/cuda/detail/copy_if.h b/thrust/system/cuda/detail/copy_if.h index 1990d17b9..5e760c086 100644 --- a/thrust/system/cuda/detail/copy_if.h +++ b/thrust/system/cuda/detail/copy_if.h @@ -786,19 +786,18 @@ copy_if(execution_policy &policy, OutputIterator result, Predicate pred) { - THRUST_CDP_DISPATCH((result = __copy_if::copy_if(policy, + THRUST_CDP_DISPATCH((return __copy_if::copy_if(policy, first, last, __copy_if::no_stencil_tag(), result, pred);), - (result = + (return thrust::copy_if(cvt_to_seq(derived_cast(policy)), first, last, result, pred);)); - return result; } // func copy_if __thrust_exec_check_disable__ @@ -816,14 +815,13 @@ copy_if(execution_policy &policy, Predicate pred) { THRUST_CDP_DISPATCH( - (result = __copy_if::copy_if(policy, first, last, stencil, result, pred);), - (result = thrust::copy_if(cvt_to_seq(derived_cast(policy)), + (return __copy_if::copy_if(policy, first, last, stencil, result, pred);), + (return thrust::copy_if(cvt_to_seq(derived_cast(policy)), first, last, stencil, result, pred);)); - return result; } // func copy_if } // namespace cuda_cub